What’s New in Python 2.7¶
| Author: | A.M. Kuchling (amk at amk.ca) |
|---|
This article explains the new features in Python 2.7. Python 2.7 was released on July 3, 2010.
Numeric handling has been improved in many ways, for both
floating-point numbers and for the Decimal class.
There are some useful additions to the standard library, such as a
greatly enhanced unittest module, the argparse module
for parsing command-line options, convenient OrderedDict
and Counter classes in the collections module,
and many other improvements.
Python 2.7 is planned to be the last of the 2.x releases, so we worked on making it a good release for the long term. To help with porting to Python 3, several new features from the Python 3.x series have been included in 2.7.
This article doesn’t attempt to provide a complete specification of the new features, but instead provides a convenient overview. For full details, you should refer to the documentation for Python 2.7 at https://docs.python.org. If you want to understand the rationale for the design and implementation, refer to the PEP for a particular new feature or the issue on https://bugs.python.org in which a change was discussed. Whenever possible, “What’s New in Python” links to the bug/patch item for each change.
Contents¶
- 1. The Future for Python 2.x
- 2. Changes to the Handling of Deprecation Warnings
- 3. Python 3.1 Features
- 4. PEP 372: Adding an Ordered Dictionary to collections
- 5. PEP 378: Format Specifier for Thousands Separator
- 6. PEP 389: The argparse Module for Parsing Command Lines
- 7. PEP 391: Dictionary-Based Configuration For Logging
- 8. PEP 3106: Dictionary Views
- 9. PEP 3137: The memoryview Object
- 10. Other Language Changes
- 11. New and Improved Modules
- 12. Build and C API Changes
- 13. Other Changes and Fixes
- 14. Porting to Python 2.7
- 15. New Features Added to Python 2.7 Maintenance Releases
- 15.1. PEP 434: IDLE Enhancement Exception for All Branches
- 15.2. PEP 466: Network Security Enhancements for Python 2.7
- 15.3. PEP 477: Backport ensurepip (PEP 453) to Python 2.7
- 15.4. PEP 476: Enabling certificate verification by default for stdlib http clients
- 15.5. PEP 493: HTTPS verification migration tools for Python 2.7
- 16. Acknowledgements