whatsnew/3.5: First pass over NEWS is done.
This commit is contained in:
parent
f03d50c5da
commit
336b37b1dd
|
@ -1157,3 +1157,7 @@ attribute.
|
||||||
be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a
|
be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a
|
||||||
subclass) or an arbitrary sequence which can be converted into a string using
|
subclass) or an arbitrary sequence which can be converted into a string using
|
||||||
the built-in :func:`str` function.
|
the built-in :func:`str` function.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.5
|
||||||
|
New methods ``__getnewargs__``, ``__rmod__``, ``casefold``,
|
||||||
|
``format_map``, ``isprintable``, and ``maketrans``.
|
||||||
|
|
|
@ -112,11 +112,13 @@ Significantly Improved Library Modules:
|
||||||
:issue:`16991`.
|
:issue:`16991`.
|
||||||
|
|
||||||
* You may now pass bytes to the :mod:`tempfile` module's APIs and it will
|
* You may now pass bytes to the :mod:`tempfile` module's APIs and it will
|
||||||
return the temporary pathname as bytes instead of str. It also accepts
|
return the temporary pathname as :class:`bytes` instead of :class:`str`.
|
||||||
a value of ``None`` on parameters where only str was accepted in the past to
|
It also accepts a value of ``None`` on parameters where only str was
|
||||||
do the right thing based on the types of the other inputs. Two functions,
|
accepted in the past to do the right thing based on the types of the
|
||||||
:func:`gettempdirb` and :func:`gettempprefixb`, have been added to go along
|
other inputs. Two functions, :func:`gettempdirb` and
|
||||||
with this. This behavior matches that of the :mod:`os` APIs.
|
:func:`gettempprefixb`, have been added to go along with this.
|
||||||
|
This behavior matches that of the :mod:`os` APIs.
|
||||||
|
(Contributed by Gregory P. Smith in :issue:`24230`.)
|
||||||
|
|
||||||
* :mod:`ssl` module gained support for Memory BIO, which decouples SSL
|
* :mod:`ssl` module gained support for Memory BIO, which decouples SSL
|
||||||
protocol handling from network IO. (Contributed by Geert Jansen in
|
protocol handling from network IO. (Contributed by Geert Jansen in
|
||||||
|
@ -127,6 +129,10 @@ Significantly Improved Library Modules:
|
||||||
:class:`~traceback.StackSummary`, and :class:`traceback.FrameSummary`.
|
:class:`~traceback.StackSummary`, and :class:`traceback.FrameSummary`.
|
||||||
(Contributed by Robert Collins in :issue:`17911`.)
|
(Contributed by Robert Collins in :issue:`17911`.)
|
||||||
|
|
||||||
|
* Most of :func:`functools.lru_cache` machinery is now implemented in C.
|
||||||
|
(Contributed by Matt Joiner, Alexey Kachayev, and Serhiy Storchaka
|
||||||
|
in :issue:`14373`.)
|
||||||
|
|
||||||
Security improvements:
|
Security improvements:
|
||||||
|
|
||||||
* SSLv3 is now disabled throughout the standard library.
|
* SSLv3 is now disabled throughout the standard library.
|
||||||
|
@ -428,14 +434,14 @@ not raise an exception:
|
||||||
for the rationale);
|
for the rationale);
|
||||||
|
|
||||||
* :mod:`select` functions: :func:`~select.devpoll.poll`,
|
* :mod:`select` functions: :func:`~select.devpoll.poll`,
|
||||||
:func:`~select.epoll.poll`, :func:`~select.kqueue.control`,
|
:func:`~select.epoll.poll`, :func:`~select.kqueue.control`,
|
||||||
:func:`~select.poll.poll`, :func:`~select.select`;
|
:func:`~select.poll.poll`, :func:`~select.select`;
|
||||||
|
|
||||||
* :func:`socket.socket` methods: :meth:`~socket.socket.accept`,
|
* :func:`socket.socket` methods: :meth:`~socket.socket.accept`,
|
||||||
:meth:`~socket.socket.connect` (except for non-blocking sockets),
|
:meth:`~socket.socket.connect` (except for non-blocking sockets),
|
||||||
:meth:`~socket.socket.recv`, :meth:`~socket.socket.recvfrom`,
|
:meth:`~socket.socket.recv`, :meth:`~socket.socket.recvfrom`,
|
||||||
:meth:`~socket.socket.recvmsg`, :meth:`~socket.socket.send`,
|
:meth:`~socket.socket.recvmsg`, :meth:`~socket.socket.send`,
|
||||||
:meth:`~socket.socket.sendall`, :meth:`~socket.socket.sendmsg`,
|
:meth:`~socket.socket.sendall`, :meth:`~socket.socket.sendmsg`,
|
||||||
:meth:`~socket.socket.sendto`;
|
:meth:`~socket.socket.sendto`;
|
||||||
|
|
||||||
* :func:`signal.sigtimedwait`, :func:`signal.sigwaitinfo`;
|
* :func:`signal.sigtimedwait`, :func:`signal.sigwaitinfo`;
|
||||||
|
@ -556,6 +562,9 @@ Some smaller changes made to the core Python language are:
|
||||||
* New Tajik :ref:`codec <standard-encodings>` ``koi8_t``. (Contributed by
|
* New Tajik :ref:`codec <standard-encodings>` ``koi8_t``. (Contributed by
|
||||||
Serhiy Storchaka in :issue:`22681`.)
|
Serhiy Storchaka in :issue:`22681`.)
|
||||||
|
|
||||||
|
* Circular imports involving relative imports are now supported.
|
||||||
|
(Contributed by Brett Cannon and Antoine Pitrou in :issue:`17636`.)
|
||||||
|
|
||||||
|
|
||||||
New Modules
|
New Modules
|
||||||
===========
|
===========
|
||||||
|
@ -589,6 +598,11 @@ argparse
|
||||||
:ref:`allow_abbrev` to ``False``.
|
:ref:`allow_abbrev` to ``False``.
|
||||||
(Contributed by Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.)
|
(Contributed by Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.)
|
||||||
|
|
||||||
|
* New *allow_abbrev* parameter for :class:`~argparse.ArgumentParser` to
|
||||||
|
allow long options to be abbreviated if the abbreviation is unambiguous.
|
||||||
|
(Contributed by Jonathan Paugh, Steven Bethard, paul j3 and
|
||||||
|
Daniel Eriksson in :issue:`14910`.)
|
||||||
|
|
||||||
bz2
|
bz2
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -628,6 +642,33 @@ collections
|
||||||
|
|
||||||
(Contributed by Berker Peksag in :issue:`24064`.)
|
(Contributed by Berker Peksag in :issue:`24064`.)
|
||||||
|
|
||||||
|
* :class:`~collections.deque` has new methods:
|
||||||
|
:meth:`~collections.deque.index`, :meth:`~collections.deque.insert`, and
|
||||||
|
:meth:`~collections.deque.copy`. This allows deques to be registered as a
|
||||||
|
:class:`~collections.abc.MutableSequence` and improves their
|
||||||
|
substitutablity for lists.
|
||||||
|
(Contributed by Raymond Hettinger :issue:`23704`.)
|
||||||
|
|
||||||
|
* :class:`~collections.UserString` now supports ``__getnewargs__``,
|
||||||
|
``__rmod__``, ``casefold``, ``format_map``, ``isprintable``, and
|
||||||
|
``maketrans`` methods.
|
||||||
|
(Contributed by Joe Jevnik in :issue:`22189`.)
|
||||||
|
|
||||||
|
* :class:`collections.OrderedDict` is now implemented in C, which improves
|
||||||
|
its performance between 4x to 100x times.
|
||||||
|
(Contributed by Eric Snow in :issue:`16991`.)
|
||||||
|
|
||||||
|
collections.abc
|
||||||
|
---------------
|
||||||
|
|
||||||
|
* New :class:`~collections.abc.Generator` abstract base class.
|
||||||
|
(Contributed by Stefan Behnel in :issue:`24018`.)
|
||||||
|
|
||||||
|
* New :class:`~collections.abc.Coroutine`,
|
||||||
|
:class:`~collections.abc.AsyncIterator`, and
|
||||||
|
:class:`~collections.abc.AsyncIterable` abstract base classes.
|
||||||
|
(Contributed by Yury Selivanov in :issue:`24184`.)
|
||||||
|
|
||||||
compileall
|
compileall
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -672,7 +713,8 @@ difflib
|
||||||
(Contributed by Berker Peksag in :issue:`2052`.)
|
(Contributed by Berker Peksag in :issue:`2052`.)
|
||||||
|
|
||||||
* It's now possible to compare lists of byte strings with
|
* It's now possible to compare lists of byte strings with
|
||||||
:func:`difflib.diff_bytes` (fixes a regression from Python 2).
|
:func:`difflib.diff_bytes`. This fixes a regression from Python 2.
|
||||||
|
(Contributed by Terry J. Reedy and Greg Ward in :issue:`17445`.)
|
||||||
|
|
||||||
distutils
|
distutils
|
||||||
---------
|
---------
|
||||||
|
@ -711,9 +753,26 @@ email
|
||||||
:rfc:`6532` and used with an SMTP server that supports the :rfc:`6531`
|
:rfc:`6532` and used with an SMTP server that supports the :rfc:`6531`
|
||||||
``SMTPUTF8`` extension. (Contributed by R. David Murray in :issue:`24211`.)
|
``SMTPUTF8`` extension. (Contributed by R. David Murray in :issue:`24211`.)
|
||||||
|
|
||||||
|
faulthandler
|
||||||
|
------------
|
||||||
|
|
||||||
|
* :func:`~faulthandler.enable`, :func:`~faulthandler.register`,
|
||||||
|
:func:`~faulthandler.dump_traceback` and
|
||||||
|
:func:`~faulthandler.dump_traceback_later` functions now accept file
|
||||||
|
descriptors. (Contributed by Wei Wu in :issue:`23566`.)
|
||||||
|
|
||||||
|
functools
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Most of :func:`~functools.lru_cache` machinery is now implemented in C.
|
||||||
|
(Contributed by Matt Joiner, Alexey Kachayev, and Serhiy Storchaka
|
||||||
|
in :issue:`14373`.)
|
||||||
|
|
||||||
glob
|
glob
|
||||||
----
|
----
|
||||||
|
|
||||||
|
00002-5938667
|
||||||
|
|
||||||
* :func:`~glob.iglob` and :func:`~glob.glob` now support recursive search in
|
* :func:`~glob.iglob` and :func:`~glob.glob` now support recursive search in
|
||||||
subdirectories using the "``**``" pattern.
|
subdirectories using the "``**``" pattern.
|
||||||
(Contributed by Serhiy Storchaka in :issue:`13968`.)
|
(Contributed by Serhiy Storchaka in :issue:`13968`.)
|
||||||
|
@ -805,6 +864,13 @@ inspect
|
||||||
and :func:`~inspect.getinnerframes` now return a list of named tuples.
|
and :func:`~inspect.getinnerframes` now return a list of named tuples.
|
||||||
(Contributed by Daniel Shahaf in :issue:`16808`.)
|
(Contributed by Daniel Shahaf in :issue:`16808`.)
|
||||||
|
|
||||||
|
io
|
||||||
|
--
|
||||||
|
|
||||||
|
* New Python implementation of :class:`io.FileIO` to make dependency on
|
||||||
|
``_io`` module optional.
|
||||||
|
(Contributed by Serhiy Storchaka in :issue:`21859`.)
|
||||||
|
|
||||||
ipaddress
|
ipaddress
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
@ -845,6 +911,10 @@ logging
|
||||||
for HTTP connection.
|
for HTTP connection.
|
||||||
(Contributed by Alex Gaynor in :issue:`22788`.)
|
(Contributed by Alex Gaynor in :issue:`22788`.)
|
||||||
|
|
||||||
|
* :class:`~logging.handlers.QueueListener` now takes a *respect_handler_level*
|
||||||
|
keyword argument which, if set to ``True``, will pass messages to handlers
|
||||||
|
taking handler levels into account. (Contributed by Vinay Sajip.)
|
||||||
|
|
||||||
lzma
|
lzma
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@ -852,15 +922,26 @@ lzma
|
||||||
to limit the maximum size of decompressed data.
|
to limit the maximum size of decompressed data.
|
||||||
(Contributed by Martin Panter in :issue:`15955`.)
|
(Contributed by Martin Panter in :issue:`15955`.)
|
||||||
|
|
||||||
|
|
||||||
math
|
math
|
||||||
----
|
----
|
||||||
|
|
||||||
* :data:`math.inf` and :data:`math.nan` constants added. (Contributed by Mark
|
* :data:`math.inf` and :data:`math.nan` constants added. (Contributed by Mark
|
||||||
Dickinson in :issue:`23185`.)
|
Dickinson in :issue:`23185`.)
|
||||||
* :func:`math.isclose` function added.
|
|
||||||
|
* New :func:`~math.isclose` function.
|
||||||
(Contributed by Chris Barker and Tal Einat in :issue:`24270`.)
|
(Contributed by Chris Barker and Tal Einat in :issue:`24270`.)
|
||||||
|
|
||||||
|
* New :func:`~math.gcd` function. The :func:`fractions.gcd` function now is
|
||||||
|
deprecated.
|
||||||
|
(Contributed by Mark Dickinson and Serhiy Storchaka in :issue:`22486`.)
|
||||||
|
|
||||||
|
operator
|
||||||
|
--------
|
||||||
|
|
||||||
|
* :func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and
|
||||||
|
:func:`~operator.methodcaller` objects now support pickling.
|
||||||
|
(Contributed by Josh Rosenberg and Serhiy Storchaka in :issue:`22955`.)
|
||||||
|
|
||||||
os
|
os
|
||||||
--
|
--
|
||||||
|
|
||||||
|
@ -877,11 +958,15 @@ os
|
||||||
now used when available. On OpenBSD 5.6 and newer, the C ``getentropy()``
|
now used when available. On OpenBSD 5.6 and newer, the C ``getentropy()``
|
||||||
function is now used. These functions avoid the usage of an internal file
|
function is now used. These functions avoid the usage of an internal file
|
||||||
descriptor.
|
descriptor.
|
||||||
|
(Contributed by Victor Stinner in :issue:`22181`.)
|
||||||
|
|
||||||
* New :func:`os.get_blocking` and :func:`os.set_blocking` functions to
|
* New :func:`os.get_blocking` and :func:`os.set_blocking` functions to
|
||||||
get and set the blocking mode of file descriptors.
|
get and set the blocking mode of file descriptors.
|
||||||
(Contributed by Victor Stinner in :issue:`22054`.)
|
(Contributed by Victor Stinner in :issue:`22054`.)
|
||||||
|
|
||||||
|
* :func:`~os.truncate` and :func:`~os.ftruncate` are now supported on
|
||||||
|
Windows. (Contributed by Steve Dower in :issue:`23668`.)
|
||||||
|
|
||||||
os.path
|
os.path
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -1034,6 +1119,9 @@ ssl
|
||||||
list of ciphers sent at handshake.
|
list of ciphers sent at handshake.
|
||||||
(Contributed by Benjamin Peterson in :issue:`23186`.)
|
(Contributed by Benjamin Peterson in :issue:`23186`.)
|
||||||
|
|
||||||
|
* :func:`~ssl.match_hostname` now supports matching of IP addresses.
|
||||||
|
(Contributed by Antoine Pitrou in :issue:`23239`.)
|
||||||
|
|
||||||
socket
|
socket
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -1099,6 +1187,13 @@ time
|
||||||
* The :func:`time.monotonic` function is now always available. (Contributed by
|
* The :func:`time.monotonic` function is now always available. (Contributed by
|
||||||
Victor Stinner in :issue:`22043`.)
|
Victor Stinner in :issue:`22043`.)
|
||||||
|
|
||||||
|
timeit
|
||||||
|
------
|
||||||
|
|
||||||
|
* New command line option ``-u`` or ``--unit=U`` to specify a time unit for
|
||||||
|
the timer output. Supported options are ``usec``, ``msec``, or ``sec``.
|
||||||
|
(Contributed by Julian Gindi in :issue:`18983`.)
|
||||||
|
|
||||||
tkinter
|
tkinter
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -1118,6 +1213,11 @@ traceback
|
||||||
:class:`~traceback.StackSummary`, and :class:`traceback.FrameSummary`.
|
:class:`~traceback.StackSummary`, and :class:`traceback.FrameSummary`.
|
||||||
(Contributed by Robert Collins in :issue:`17911`.)
|
(Contributed by Robert Collins in :issue:`17911`.)
|
||||||
|
|
||||||
|
* :func:`~traceback.print_tb` and :func:`~traceback.print_stack` now support
|
||||||
|
negative values for the *limit* argument.
|
||||||
|
(Contributed by Dmitry Kazakov in :issue:`22619`.)
|
||||||
|
|
||||||
|
|
||||||
types
|
types
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -1152,6 +1252,12 @@ unicodedata
|
||||||
* The :mod:`unicodedata` module now uses data from `Unicode 8.0.0
|
* The :mod:`unicodedata` module now uses data from `Unicode 8.0.0
|
||||||
<http://unicode.org/versions/Unicode8.0.0/>`_.
|
<http://unicode.org/versions/Unicode8.0.0/>`_.
|
||||||
|
|
||||||
|
unittest
|
||||||
|
--------
|
||||||
|
|
||||||
|
* New command line option ``--locals`` to show local variables in
|
||||||
|
tracebacks.
|
||||||
|
(Contributed by Robert Collins in :issue:`22936`.)
|
||||||
|
|
||||||
wsgiref
|
wsgiref
|
||||||
-------
|
-------
|
||||||
|
@ -1176,14 +1282,6 @@ xml.sax
|
||||||
:class:`~xml.sax.xmlreader.InputSource` object.
|
:class:`~xml.sax.xmlreader.InputSource` object.
|
||||||
(Contributed by Serhiy Storchaka in :issue:`2175`.)
|
(Contributed by Serhiy Storchaka in :issue:`2175`.)
|
||||||
|
|
||||||
faulthandler
|
|
||||||
------------
|
|
||||||
|
|
||||||
* :func:`~faulthandler.enable`, :func:`~faulthandler.register`,
|
|
||||||
:func:`~faulthandler.dump_traceback` and
|
|
||||||
:func:`~faulthandler.dump_traceback_later` functions now accept file
|
|
||||||
descriptors. (Contributed by Wei Wu in :issue:`23566`.)
|
|
||||||
|
|
||||||
zipfile
|
zipfile
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -1194,6 +1292,14 @@ zipfile
|
||||||
creation) mode. (Contributed by Serhiy Storchaka in :issue:`21717`.)
|
creation) mode. (Contributed by Serhiy Storchaka in :issue:`21717`.)
|
||||||
|
|
||||||
|
|
||||||
|
Other module-level changes
|
||||||
|
==========================
|
||||||
|
|
||||||
|
* Many functions in modules :mod:`mmap`, :mod:`ossaudiodev`, :mod:`socket`,
|
||||||
|
:mod:`ssl`, and :mod:`codecs`, now accept writable bytes-like objects.
|
||||||
|
(Contributed by Serhiy Storchaka in :issue:`23001`.)
|
||||||
|
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
@ -1237,6 +1343,22 @@ The following performance enhancements have been added:
|
||||||
as fast as with ``ensure_ascii=True``.
|
as fast as with ``ensure_ascii=True``.
|
||||||
(Contributed by Naoki Inada in :issue:`23206`.)
|
(Contributed by Naoki Inada in :issue:`23206`.)
|
||||||
|
|
||||||
|
* :c:func:`PyObject_IsInstance` and :c:func:`PyObject_IsSubclass` have
|
||||||
|
been sped up in the common case that the second argument has metaclass
|
||||||
|
:class:`type`.
|
||||||
|
(Contributed Georg Brandl by in :issue:`22540`.)
|
||||||
|
|
||||||
|
* Method caching was slightly improved, yielding up to 5% performance
|
||||||
|
improvement in some benchmarks.
|
||||||
|
(Contributed by Antoine Pitrou in :issue:`22847`.)
|
||||||
|
|
||||||
|
* Objects from :mod:`random` module now use 2x less memory on 64-bit
|
||||||
|
builds.
|
||||||
|
(Contributed by Serhiy Storchaka in :issue:`23488`.)
|
||||||
|
|
||||||
|
* property() getter calls are up to 25% faster.
|
||||||
|
(Contributed by Joe Jevnik in :issue:`23910`.)
|
||||||
|
|
||||||
|
|
||||||
Build and C API Changes
|
Build and C API Changes
|
||||||
=======================
|
=======================
|
||||||
|
@ -1276,6 +1398,9 @@ Deprecated Python modules, functions and methods
|
||||||
* The :mod:`formatter` module has now graduated to full deprecation and is still
|
* The :mod:`formatter` module has now graduated to full deprecation and is still
|
||||||
slated for removal in Python 3.6.
|
slated for removal in Python 3.6.
|
||||||
|
|
||||||
|
* :func:`~asyncio.async` was deprecated in favour of
|
||||||
|
:func:`~asyncio.ensure_future`.
|
||||||
|
|
||||||
* :mod:`smtpd` has in the past always decoded the DATA portion of email
|
* :mod:`smtpd` has in the past always decoded the DATA portion of email
|
||||||
messages using the ``utf-8`` codec. This can now be controlled by the new
|
messages using the ``utf-8`` codec. This can now be controlled by the new
|
||||||
*decode_data* keyword to :class:`~smtpd.SMTPServer`. The default value is
|
*decode_data* keyword to :class:`~smtpd.SMTPServer`. The default value is
|
||||||
|
@ -1323,12 +1448,6 @@ Deprecated functions and types of the C API
|
||||||
* None yet.
|
* None yet.
|
||||||
|
|
||||||
|
|
||||||
Deprecated features
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
* None yet.
|
|
||||||
|
|
||||||
|
|
||||||
Removed
|
Removed
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
@ -1486,3 +1605,5 @@ Changes in the C API
|
||||||
:c:type:`PyTypeObject` was replaced with a
|
:c:type:`PyTypeObject` was replaced with a
|
||||||
:c:member:`tp_as_async` slot. Refer to :ref:`coro-objects` for
|
:c:member:`tp_as_async` slot. Refer to :ref:`coro-objects` for
|
||||||
new types, structures and functions.
|
new types, structures and functions.
|
||||||
|
|
||||||
|
* :c:member:`PyTypeObject.tp_finalize` is now part of stable ABI.
|
||||||
|
|
Loading…
Reference in New Issue