The third edition of this book was thoroughly updated to reflect Python 2.5 and all changes to the language made after the publication of the second edition in late 2003. (The second edition was based largely on Python 2.2, with some 2.3 features grafted on at the end of the project.) In addition, brief discussions of anticipated changes in the upcoming Python 3.0 release were incorporated where appropriate. Here are some of the major language topics for which new or expanded coverage was provided (chapter numbers here have been updated to reflect this fifth edition):
The new B if A else C conditional expression (Chapter 12, Chapter 19)
with/as context managers (Chapter 34)
try/except/finally unification (Chapter 34)
Relative import syntax (Chapter 24)
Generator expressions (Chapter 20)
New generator function features (Chapter 20)
Function decorators (Chapter 32, Chapter 39)
The set object type (Chapter 5)
New built-in functions: sorted, sum, any, all, enumerate (Chapter 13 and Chapter 14)
The decimal fixed-precision object type (Chapter 5)
Files, list comprehensions, and iterators (Chapter 14 and Chapter 20)
New development tools: Eclipse, distutils, unittest and doctest, IDLE enhancements, Shed Skin, and so on (Chapter 2 and Chapter 36)
Smaller language changes (for instance, the widespread use of True and False; the new sys.exc_info for fetching exception details; and the demise of string-based exceptions, string methods, and the apply and reduce built-ins) were incorporated throughout the book. The third edition also expanded coverage of some of the features that were new in the second edition, including three-limit slices and the arbitrary arguments call syntax that subsumed apply.