This article explains the new features in Python 3.4, compared to 3.3.
For full details, see the changelog.
Prerelease users should be aware that this document is currently in draft form. It will be updated substantially as Python 3.4 moves towards release, so it’s worth checking back even after reading earlier versions.
New syntax features:
New library modules:
New built-in features:
Significantly Improved Library Modules:
Please read on for a comprehensive list of user-facing changes.
Some smaller changes made to the core Python language are:
The dis module is now built around an Instruction class that provides details of individual bytecode operations and a get_instructions() iterator that emits the Instruction stream for a given piece of Python code. The various display tools in the dis module have been updated to be based on these new components.
The new dis.Bytecode class provides an object-oriented API for inspecting bytecode, both in human-readable form and for iterating over instructions.
(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in issue 11816)
Added FAIL_FAST flag to halt test running as soon as the first failure is detected. (Contributed by R. David Murray and Daniel Urban in issue 16522.)
SMTPException is now a subclass of OSError, which allows both socket level errors and SMTP protocol level errors to be caught in one try/except statement by code that only cares whether or not an error occurred. (issue 2118).
Major performance enhancements have been added:
Changes to Python’s build process and to the C API include:
This section lists previously described changes and other bugfixes that may require changes to your code.