## Contents

- 1 PEP 218: Built-In Set Objects
- 2 PEP 237: Unifying Long Integers and Integers
- 3 PEP 289: Generator Expressions
- 4 PEP 292: Simpler String Substitutions
- 5 PEP 318: Decorators for Functions and Methods
- 6 PEP 322: Reverse Iteration
- 7 PEP 324: New subprocess Module
- 8 PEP 327: Decimal Data Type
  - 8.1 Why is Decimal needed?
  - 8.2 The Decimal type
  - 8.3 The Context type
- 9 PEP 328: Multi-line Imports
- 10 PEP 331: Locale-Independent Float/String Conversions
- 11 Other Language Changes
  - 11.1 Optimizations
- 12 New, Improved, and Deprecated Modules
  - 12.1 cookielib
  - 12.2 doctest
- 13 Build and C API Changes
  - 13.1 Port-Specific Changes
- 14 Porting to Python 2.4
- 15 Acknowledgements

This article explains the new features in Python 2.4, released in December 2004.

Python 2.4 is a medium-sized release. It doesn't introduce as many changes as the radical Python 2.2, but introduces more features than the conservative 2.3 release. The most significant new language features are function decorators and generator expressions; most other changes are to the standard library.

According to the CVS change logs, there were 481 patches applied and 502 bugs fixed between Python 2.3 and 2.4. Both figures are likely to be underestimates.

This article doesn't attempt to provide a complete specification of every single new feature, but instead provides a brief introduction to each feature. For full details, you should refer to the documentation for Python 2.4, such as the Python Library Reference and the Python Reference Manual. Often you will be referred to the PEP for a particular new feature for explanations of the implementation and design rationale.