Python Cookbook Edited by Alex Martelli, David Ascher The following errata were corrected in the 3/04 reprint: 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 {3} first paragraph; def method(self, argument, *args, **kw): # do something with argument apply(callable, args, kw) NOW READS: def method(self, argument, *args, **kw): # do something with argument callable(*args, **kw) Also - def method(self, argument, *args, **kw): # do something with argument apply(callable_object, args, kw) NOW READS: def method(self, argument, *args, **kw): # do something with argument callable_object(*args, **kw) (66) 3rd paragraph; htmilib NOW READS: htmllib (98) 1st paragrap, seciond half of code block; # Prepare the Commands list for exeution by compiling each re for cmd in Commands: NOW READS: # Prepare the Commands list for exeution by compiling each re for cmd in Commands: Also, the try/except block that follows HAS BEEN INDENTED by 4 spaces. (169) all 5 recipes; for base in self__class__.__bases__: NOW READS: for base in self.__class__.__bases__: (The pages affected by this repeated change are 169 to 171, all examples). (201) In definition of RingBuffer class; self.__class__ = __Full NOW READS: self.__class__ = self.__Full [309] 4th paragraph: the example code that does open("icon.gif") etc.; print "icon='''\\\n" + base64.encodestring(open("icon.gif").read()) + "'''" NOW READS: print "icon='''\\\n" + base64.encodestring(open("icon.gif", "rb").read()) + "'''" {339} try: ftp.login(username, password) except ftp.all_errors, error: print 'Cannot login:', error The second line NOW READS: except ftplib.all_errors, error: (383) 1st paragraph; for tag in tags: print tag, handler.tags[tag] The second line HAS BEEN INDENTED. (389) IN PRINT: Solution: 5th line of program; .replace(''', """)\ NOW READS: .replace('"', """)\ {426} 4th paragraph, the fifth line of code; for x not in init_modules: NOW READS: for m not in init_modules: (533) Lines 8, 10, 11; print a.pop(0) NOW READS: print a.pop()