on Unix <whatsnew-multiprocessing-no-fork>` (:issue:`8713`).
* :mod:`email` has a new submodule, :mod:`~email.contentmanager`, and
a new :mod:`~email.message.Message` subclass
- (:class:`~email.contentmanager.EmailMessage`) that :ref:`simplify MIME
+ (:class:`~email.message.EmailMessage`) that :ref:`simplify MIME
handling <whatsnew_email_contentmanager>` (:issue:`18891`).
* The :mod:`inspect` and :mod:`pydoc` modules are now capable of
correct introspection of a much wider variety of callable objects,
<whatsnew34-sslcontext>`.
* All modules in the standard library that support SSL now support server
certificate verification, including hostname matching
- (:func:`ssl.match_hostname`) and CRLs (Certificate Revocation lists, see
+ (:func:`!ssl.match_hostname`) and CRLs (Certificate Revocation lists, see
:func:`ssl.SSLContext.load_verify_locations`).
CPython implementation improvements:
In addition, a new application-friendly class :class:`~dis.Bytecode` provides
an object-oriented API for inspecting bytecode in both in human-readable form
and for iterating over instructions. The :class:`~dis.Bytecode` constructor
-takes the same arguments that :func:`~dis.get_instruction` does (plus an
+takes the same arguments that :func:`~dis.get_instructions` does (plus an
optional *current_offset*), and the resulting object can be iterated to produce
:class:`~dis.Instruction` objects. But it also has a :mod:`~dis.Bytecode.dis`
method, equivalent to calling :mod:`~dis.dis` on the constructor argument, but
optional additional *explain* parameter which can be used to provide an
extended error description, overriding the hardcoded default if there is one.
This extended error description will be formatted using the
-:attr:`~http.server.HTTP.error_message_format` attribute and sent as the body
-of the error response. (Contributed by Karl Cow in :issue:`12921`.)
+:attr:`~http.server.BaseHTTPRequestHandler.error_message_format` attribute
+and sent as the body of the error response.
+(Contributed by Karl Cow in :issue:`12921`.)
The :mod:`http.server` :ref:`command line interface <http-server-cli>` now has
a ``-b/--bind`` option that causes the server to listen on a specific address.
:mod:`pickle` now supports (but does not use by default) a new pickle protocol,
protocol 4. This new protocol addresses a number of issues that were present
in previous protocols, such as the serialization of nested classes, very large
-strings and containers, and classes whose :meth:`__new__` method takes
+strings and containers, and classes whose :meth:`~object.__new__` method takes
keyword-only arguments. It also provides some efficiency improvements.
.. seealso::
re
--
-New :func:`~re.fullmatch` function and :meth:`.regex.fullmatch` method anchor
+New :func:`~re.fullmatch` function and :meth:`.Pattern.fullmatch` method anchor
the pattern at both ends of the string to match. This provides a way to be
explicit about the goal of the match, which avoids a class of subtle bugs where
``$`` characters get lost during code changes or the addition of alternatives
be used to provide the contents of ``stdin`` for the command that is run.
(Contributed by Zack Weinberg in :issue:`16624`.)
-:func:`~subprocess.getstatus` and :func:`~subprocess.getstatusoutput` now
+:func:`~subprocess.getoutput` and :func:`~subprocess.getstatusoutput` now
work on Windows. This change was actually inadvertently made in 3.3.4.
(Contributed by Tim Golden in :issue:`10197`.)
called automatically at the end of the block. (Contributed by Serhiy Storchaka
in :issue:`18878`.)
-:meth:`.AU_write.setsampwidth` now supports 24 bit samples, thus adding
+:meth:`!AU_write.setsampwidth` now supports 24 bit samples, thus adding
support for writing 24 sample using the module. (Contributed by
Serhiy Storchaka in :issue:`19261`.)
an attribute that acts normally when looked up through an instance object, but
which is routed to the *class* ``__getattr__`` when looked up through the
class. This allows one to have properties active on a class, and have virtual
-attributes on the class with the same name (see :mod:`Enum` for an example).
+attributes on the class with the same name (see :mod:`enum` for an example).
(Contributed by Ethan Furman in :issue:`19030`.)
or name, instead of only by position. (Contributed by Antoine Pitrou in
:issue:`17015`.)
-:func:`~mock.mock_open` objects now have ``readline`` and ``readlines``
+:func:`~unittest.mock.mock_open` objects now have ``readline`` and ``readlines``
methods. (Contributed by Toshio Kuratomi in :issue:`17467`.)
wave
----
-The :meth:`~wave.getparams` method now returns a namedtuple rather than a
-plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.)
+The :meth:`~wave.Wave_read.getparams` method now returns a namedtuple rather
+than a plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.)
:meth:`wave.open` now supports the context management protocol. (Contributed
by Claudiu Popa in :issue:`17616`.)
(Contributed by Christian Tismer in :issue:`19274`.)
The *allowZip64* parameter to :class:`~zipfile.ZipFile` and
-:class:`~zipfile.PyZipfile` is now ``True`` by default. (Contributed by
+:class:`~zipfile.PyZipFile` is now ``True`` by default. (Contributed by
William Mallard in :issue:`17201`.)
---------------------------------
:pep:`442` removes the current limitations and quirks of object finalization
-in CPython. With it, objects with :meth:`__del__` methods, as well as
+in CPython. With it, objects with :meth:`~object.__del__` methods, as well as
generators with :keyword:`finally` clauses, can be finalized when they are
part of a reference cycle.
strings is now significantly faster. (Contributed by Victor Stinner and
Antoine Pitrou in :issue:`15596`.)
-* A performance issue in :meth:`io.FileIO.readall` has been solved. This
+* A performance issue in :meth:`!io.FileIO.readall` has been solved. This
particularly affects Windows, and significantly speeds up the case of piping
significant amounts of data through :mod:`subprocess`. (Contributed
by Richard Oudkerk in :issue:`15758`.)
* The :mod:`!imp` module is pending deprecation. To keep compatibility with
Python 2/3 code bases, the module's removal is currently not scheduled.
-* The :mod:`formatter` module is pending deprecation and is slated for removal
+* The :mod:`!formatter` module is pending deprecation and is slated for removal
in Python 3.6.
* ``MD5`` as the default *digestmod* for the :func:`hmac.new` function is
* The *strict* argument of :class:`~html.parser.HTMLParser` is deprecated.
-* The :mod:`plistlib` :func:`~plistlib.readPlist`,
- :func:`~plistlib.writePlist`, :func:`~plistlib.readPlistFromBytes`, and
- :func:`~plistlib.writePlistToBytes` functions are deprecated in favor of the
+* The :mod:`plistlib` :func:`!readPlist`,
+ :func:`!writePlist`, :func:`!readPlistFromBytes`, and
+ :func:`!writePlistToBytes` functions are deprecated in favor of the
corresponding new functions :func:`~plistlib.load`, :func:`~plistlib.dump`,
- :func:`~plistlib.loads`, and :func:`~plistlib.dumps`. :func:`~plistlib.Data`
+ :func:`~plistlib.loads`, and :func:`~plistlib.dumps`. :func:`!Data`
is deprecated in favor of just using the :class:`bytes` constructor.
* The :mod:`sysconfig` key ``SO`` is deprecated, it has been replaced by
that do not have a __format__ method that handles it. See :issue:`7994` for
background.
-* :meth:`difflib.SequenceMatcher.isbjunk` and
- :meth:`difflib.SequenceMatcher.isbpopular` were deprecated in 3.2, and have
+* :meth:`!difflib.SequenceMatcher.isbjunk` and
+ :meth:`!difflib.SequenceMatcher.isbpopular` were deprecated in 3.2, and have
now been removed: use ``x in sm.bjunk`` and
``x in sm.bpopular``, where *sm* is a :class:`~difflib.SequenceMatcher` object
(:issue:`13248`).
* :meth:`!importlib.util.module_for_loader` now sets ``__loader__`` and
``__package__`` unconditionally to properly support reloading. If this is not
desired then you will need to set these attributes manually. You can use
- :func:`importlib.util.module_to_load` for module management.
+ :func:`!importlib.util.module_to_load` for module management.
* Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``,
``__package__``, ``__file__``, ``__cached__``) unconditionally when reloading.
disallowed command forms didn't make any sense and are unlikely to be in use.
* The :func:`re.split`, :func:`re.findall`, and :func:`re.sub` functions, and
- the :meth:`~re.match.group` and :meth:`~re.match.groups` methods of
+ the :meth:`~re.Match.group` and :meth:`~re.Match.groups` methods of
``match`` objects now always return a *bytes* object when the string
to be matched is a :term:`bytes-like object`. Previously the return type
matched the input type, so if your code was depending on the return value