Python Cookbook edited by Alex Martelli, David Ascher The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated June 17, 2004. UNCONFIRMED errors and comments from readers: {87} Section 3.13 Expanding and Compressing Tabs Section 3.13 Expanding and Compressing Tabs, fails to take newline (\n) into account. Python's expandtabs function expands tabs to spaces on a *per-line* basis. The unexpand function in 3.14.2 and expand_with_re in 3.14.3 fail to take newline into account. They treat newline (\n) as any other character. {92} middle of page (function: anytolw(), et al); The suite of functions beginning with anytolw() do not reproduce the functionality of the solution presented on the preceding page and illustrated by the examples at the top of the page. E.g.: >>> s='PrintHTML' >>> cw2us(s) 'print_html' >>> cwtous(s) 'print_h_t_m_l' [275] 3rd paragraph; The example is not wrong, but I think the emphasis is misplaced. It is not so much that "we were working with a temporary object", but that she['p']['p'] = 42 is not a write operation. The example implies that we are trying to modify a nested dictionary. What we actually want to do is modify a dictionary that is accessed via a shelf key. The relevant phrase in the language reference is 'A ``shelf'' is a persistent, dictionary-like object.' In other words, it looks like a duck, it walks with a duck-like gait, but is not in fact your actual duck. I suggest that Recipe 8.4 should say something like "The shelve module provides a wonderful way of reading and writing objects from and to files, without having to worry about how or where these objects are stored. All we need is a key to access them. The assignment operator has been overloaded to handle this file access. However, this convenient notation should not blind us to the fact that file reads and writes are still going on. ! To write to the file: key=object. Therefore we have to write she['p'] = {'p' : 42}. But we cannot combine the file key and the dictionary key: she['p']['p'] = 42 (DOESN'T WORK)." It has nothing to do with binding a name to a temporary object. It is just the syntax for the shelf write. {285} code; for dd in d: l = dd[1] . . . #the third item of the cursor.description is the display_size, so: l = dd[2] #is more appropriate {426} 4th paragraph; The fifth line of code reads: for x not in init_modules: This should be: for m not in init_modules: