2012-09-30 15:11:58 +08:00
|
|
|
****************************
|
|
|
|
What's New In Python 3.4
|
|
|
|
****************************
|
|
|
|
|
2012-10-28 20:37:54 +08:00
|
|
|
.. :Author: Someone <email>
|
|
|
|
(uncomment if there is a principal author)
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
.. Rules for maintenance:
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
* Anyone can add text to this document, but the maintainer reserves the
|
|
|
|
right to rewrite any additions. In particular, for obscure or esoteric
|
|
|
|
features, the maintainer may reduce any addition to a simple reference to
|
|
|
|
the new documentation rather than explaining the feature inline.
|
|
|
|
|
|
|
|
* While the maintainer will periodically go through Misc/NEWS
|
|
|
|
and add changes, it's best not to rely on this. We know from experience
|
|
|
|
that any changes that aren't in the What's New documentation around the
|
|
|
|
time of the original release will remain largely unknown to the community
|
|
|
|
for years, even if they're added later. We also know from experience that
|
|
|
|
other priorities can arise, and the maintainer will run out of time to do
|
|
|
|
updates - in such cases, end users will be much better served by partial
|
|
|
|
notifications that at least give a hint about new features to
|
|
|
|
investigate.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
* This is not a complete list of every single change; completeness
|
2012-09-30 21:21:53 +08:00
|
|
|
is the purpose of Misc/NEWS. The What's New should focus on changes that
|
|
|
|
are visible to Python *users* and that *require* a feature release (i.e.
|
|
|
|
most bug fixes should only be recorded in Misc/NEWS)
|
|
|
|
|
|
|
|
* PEPs should not be marked Final until they have an entry in What's New.
|
|
|
|
A placeholder entry that is just a section header and a link to the PEP
|
|
|
|
(e.g ":pep:`397` has been implemented") is acceptable. If a PEP has been
|
|
|
|
implemented and noted in What's New, don't forget to mark it as Final!
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
* If you want to draw your new text to the attention of the
|
|
|
|
maintainer, add 'XXX' to the beginning of the paragraph or
|
|
|
|
section.
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
* It's OK to add just a very brief note about a change. For
|
|
|
|
example: "The :ref:`~socket.transmogrify()` function was added to the
|
|
|
|
:mod:`socket` module." The maintainer will research the change and
|
|
|
|
write the necessary text (if appropriate). The advantage of doing this
|
|
|
|
is that even if no more descriptive text is ever added, readers will at
|
|
|
|
least have a notification that the new feature exists and a link to the
|
|
|
|
relevant documentation.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
* You can comment out your additions if you like, but it's not
|
|
|
|
necessary (especially when a final release is some months away).
|
|
|
|
|
|
|
|
* Credit the author of a patch or bugfix. Just the name is
|
|
|
|
sufficient; the e-mail address isn't necessary.
|
|
|
|
|
|
|
|
* It's helpful to add the bug/patch number as a comment:
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
The :ref:`~socket.transmogrify()` function was added to the
|
|
|
|
:mod:`socket` module. (Contributed by P.Y. Developer in :issue:`12345`.)
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
This saves the maintainer the effort of going through the Mercurial log
|
|
|
|
when researching a change.
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
* Cross referencing tip: :ref:`mod.attr` will display as ``mod.attr``,
|
|
|
|
while :ref:`~mod.attr` will display as ``attr``.
|
|
|
|
|
2012-09-30 15:11:58 +08:00
|
|
|
This article explains the new features in Python 3.4, compared to 3.3.
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
.. Python 3.4 was released on TBD.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
2012-11-18 01:30:48 +08:00
|
|
|
For full details, see the
|
|
|
|
`changelog <http://docs.python.org/3.4/whatsnew/changelog.html>`_.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
.. note:: 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.
|
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
.. :pep:`4XX` - Python 3.4 Release Schedule
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
Summary -- Release highlights
|
|
|
|
=============================
|
|
|
|
|
2013-03-26 21:56:14 +08:00
|
|
|
.. This section singles out the most important changes in Python 3.4.
|
2012-09-30 15:11:58 +08:00
|
|
|
Brevity is key.
|
|
|
|
|
|
|
|
New syntax features:
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
New library modules:
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
New built-in features:
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
Implementation improvements:
|
|
|
|
|
2013-03-26 21:56:14 +08:00
|
|
|
* A more efficient :mod:`marshal` format <http://bugs.python.org/issue16475>.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
Significantly Improved Library Modules:
|
|
|
|
|
2012-10-06 08:23:36 +08:00
|
|
|
* SHA-3 (Keccak) support for :mod:`hashlib`.
|
2013-03-29 05:24:43 +08:00
|
|
|
* TLSv1.1 and TLSv1.2 support for :mod:`ssl`.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
Security improvements:
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
Please read on for a comprehensive list of user-facing changes.
|
|
|
|
|
|
|
|
|
|
|
|
.. PEP-sized items next.
|
|
|
|
|
|
|
|
.. _pep-4XX:
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
.. PEP 4XX: Example PEP
|
|
|
|
.. ====================
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
.. (Implemented by Foo Bar.)
|
|
|
|
|
|
|
|
.. .. seealso::
|
|
|
|
|
2012-09-30 21:21:53 +08:00
|
|
|
:pep:`4XX` - Example PEP
|
|
|
|
PEP written by Example Author
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other Language Changes
|
|
|
|
======================
|
|
|
|
|
|
|
|
Some smaller changes made to the core Python language are:
|
|
|
|
|
2012-09-30 20:39:18 +08:00
|
|
|
* Unicode database updated to UCD version 6.2.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
New Modules
|
|
|
|
===========
|
|
|
|
|
|
|
|
.. module name
|
|
|
|
.. -----------
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
|
|
|
|
Improved Modules
|
|
|
|
================
|
|
|
|
|
2013-04-14 02:49:48 +08:00
|
|
|
|
2012-11-22 04:09:21 +08:00
|
|
|
doctest
|
|
|
|
-------
|
|
|
|
|
|
|
|
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`.)
|
2012-09-30 15:11:58 +08:00
|
|
|
|
2013-04-14 02:49:48 +08:00
|
|
|
|
|
|
|
smtplib
|
|
|
|
-------
|
|
|
|
|
|
|
|
:exc:`~smtplib.SMTPException` is now a subclass of :exc:`IOError`, 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`).
|
|
|
|
|
|
|
|
|
2013-04-11 00:31:43 +08:00
|
|
|
wave
|
|
|
|
----
|
|
|
|
|
|
|
|
The :meth:`~wave.getparams` method now returns a namedtuple rather than a
|
|
|
|
plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.)
|
|
|
|
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
Optimizations
|
|
|
|
=============
|
|
|
|
|
|
|
|
Major performance enhancements have been added:
|
|
|
|
|
2012-10-31 06:12:47 +08:00
|
|
|
* The UTF-32 decoder is now 3x to 4x faster.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
Build and C API Changes
|
|
|
|
=======================
|
|
|
|
|
|
|
|
Changes to Python's build process and to the C API include:
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
|
|
|
|
Deprecated
|
|
|
|
==========
|
|
|
|
|
|
|
|
Unsupported Operating Systems
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
|
|
|
|
Deprecated Python modules, functions and methods
|
|
|
|
------------------------------------------------
|
|
|
|
|
2013-03-22 07:36:26 +08:00
|
|
|
* :meth:`difflib.SequenceMatcher.isbjunk` and
|
|
|
|
:meth:`difflib.SequenceMatcher.isbpopulur`: use ``x in sm.bjunk`` and
|
|
|
|
``x in sm.bpopular``, where sm is a :class:`~difflib.SequenceMatcher` object.
|
2012-09-30 15:11:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
Deprecated functions and types of the C API
|
|
|
|
-------------------------------------------
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
|
|
|
|
Deprecated features
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
* None yet.
|
|
|
|
|
|
|
|
|
2012-10-05 00:45:10 +08:00
|
|
|
Porting to Python 3.4
|
2012-09-30 15:11:58 +08:00
|
|
|
=====================
|
|
|
|
|
|
|
|
This section lists previously described changes and other bugfixes
|
|
|
|
that may require changes to your code.
|
|
|
|
|
2013-04-10 05:03:10 +08:00
|
|
|
* The ABCs defined in :mod:`importlib.abc` now either raise the appropriate
|
|
|
|
exception or return a default value instead of raising
|
|
|
|
:exc:`NotImplementedError` blindly. This will only affect code calling
|
|
|
|
:func:`super` and falling through all the way to the ABCs. For compatibility,
|
|
|
|
catch both :exc:`NotImplementedError` or the appropriate exception as needed.
|