Python in a Nutshell by Alex Martelli Following are the changes made in the 09/03 reprint. Here's the 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 {21} The Meaning of the -tt option reads: "Like -tt, but raises an error rather than a warning" now reads: "Like -t, but raises an error rather than a warning" p. 45 -- "from future import division" now reads: "from __future__ import division" {47} Pargraph "Slicing a sequence", lines 4-5; "j is less than i" now reads: "j is less than or equal to i" {48} Modifying a list, 2nd bulleted item; L[i:i]=['a','b'] inserts the items 'a' and 'b' after item i in L. now reads: L[i:i]=['a','b'] inserts the items 'a' and 'b' before item i in L. (48) Last paragraph; The last sentence ends with "..., while L*=n has the effect of adding n copies of L to the end of L." The last sentence now reads: "..., while L *= n has the effect of adding n-1 copies of L to the end of L." (48) :"Modifying a list", first code fragment x[1] = 42 # x is now [1,42,2,3] Now reads: x[1] = 42 # x is now [1,42,3,4] (52) IN PRINT: "The if Statement", syntax listing; "else expression: statement(s)" Now reads: "else: statement(s)" (65) last code listing def percent2(a, b, c): #needs 2.2 or "from future import" Now reads: def percent2(a, b, c): #needs 2.2 or "from __future__ import" (66) 2nd code listing; def make_adder_2(augend): # needs 2.2 or "from future import" Now reads: def make_adder_2(augend): # needs 2.2 or "from __future__ import" (78) 2nd paragraph, first sentence; Missing "to" in "A bound method is similar TO an unbound method,..." has now been added. (85 & 86) code examples; The code samples use the variable "heigth", which is now correctly spelled as "height". (100) IN PRINT: Single line of code near bottom of page; "__metaclass_ = type" Now reads: "__metaclass__ = type" (112) IN PRINT: First code sample, second line; "except InvalidAttribute, err" Now reads: "except InvalidAttribute, err:" (130) buffer() function; where it says: For more on buffer, see Chapter 13. The text now reads: The buffer built-in is now deprecated. [163] IN PRINT: Code listing near top of page, third line; "if re.search(..." Now reads: "if digatend.search(..." (177) dirname; "For example, os.path.basename('b/c/d.e') returns 'b/c'" Now reads: "For examples, os.path.dirname('b/c/d.e') returns 'b/c'" (241) IN PRINT: Connection Objects - cursor method; x.close() Now reads: x.cursor() (284) IN PRINT: code sample, first line; import Threading, Queue Now reads: import threading, Queue (285) IN PRINT: code sample in middle of page, first line; import Threading, Queue Now reads: import threading, Queue (286) IN PRINT: first code sample, first line; import Threading Now reads: import threading (307) Code listing, under Slicing Examples; a[0,2:4) Now reads: a[0,2:4] [303] 5th paragraph, tofile; tofile Note that f should be open for reading in binary mode, for example with mode 'rb'. now reads: tofile Note that f should be open for writing in binary mode, for example with mode 'wb'. {312} 5th paragraph; where it says: an array with rank of one less than a and of the same size as a The text now reads: an array with rank 1 and of the same size as a {320} 3rd paragraph; where it says: just like array(a,copy=False).flat The text now reads: just like array(a,copy=(not a.iscontiguous())).flat (328) the URL: http://starbase.neosoft.com/~claird/comp.lang.python/python_GUI.html The URL has changed and now reads: http://phaseit.net/claird/comp.lang.python/python_GUI.html (335) 5th paragraph; In the example to diplay GIF images in the example, the line: img.config(image=gifsdict[imgname]) Is now indented as follows: def list_entry_clicked(*ignore): imgname = L.get(L.curselection()[0]) img.config(image=gifsdict[imgname]) {337} last table entry; toggle c.deselect() Now reads: toggle c.toggle() (342) middle of page; The entry for 'iconify' shows 'deiconify' for the example. Iconify T.deiconify() Now reads: Iconify T.iconify() [346] Under "Menu Example" heading; The following two lines have been added to the end of the script: root.config(menu=bar) Tkinter.mainloop() [361] in plot function; logical error j = CY*(y-miny)/(maxy-miny) Now reads: j = CY - CY*(y-miny)/(maxy-miny) (433) fourth and fifth functions (ntohl and ntohs); where it says ntohl htonl(i32) The text now reads: ntohl ntohl(i32) AND where it says ntohs htons(i32) The text now reads: ntohs ntohs(i32) {441} Example code at bottom of page; The example trivial HTTP server is missing the two lines to instantiate and start up the server. After the line do_HEAD = do_POST = do_GET, the following two lines have been added: server = BaseHTTPServer.HTTPServer(('',80), TrivialHTTPRequestHandler) server.serve_forever() (477) 2nd par.: MIMEImage; MIMEImage class MIMEAudio(_imagedata,... Now reads: MIMEImage class MIMEImage(_imagedata,... {499} last paragraph; quoteattr escape(data,entities={}) Now reads: quoteattr quoteattr(data,entities={}) Pages 507, 508, and 511: The following warning note has been added on page 511: The code examples given on pages 507, 508 and 511 may crash under some version of Python and Windows (not Python 2.3, and not Linux versions of Python). To fix your version of Python so that it is able to run the examples, visit URL: http://sourceforge.net/project/showfiles.php?group_id=6473 and download and run the appropriate self-installing .EXE, for example currently PyXML-0.8.2.win32-py2.2.exe if you run Python 2.2 on any version of Microsoft Windows. This self-installing EXE will add to your Python installation the latest version of the "XML subsystem" of Python, and, as a side effect, fix any bugs connected to XML handling that may have been diagnosed after the release of your version of Python. (536) Example 24-1; There are two arrays declared as static char merge_docs[] The second one (page 536) now reads: static char mergenew_docs[] = "\