[3.14] GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410) (#138423)

GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410)

Resolve reference warnings in whatsnew/3.7.rst
(cherry picked from commit dd86fb4ba5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-09-03 08:26:29 +02:00 committed by GitHub
parent da3850cfc2
commit b0069f14af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 46 deletions

View file

@ -269,6 +269,8 @@ should instead read:
(assuming a :ref:`debug build <debug-build>` of CPython 3.6) (assuming a :ref:`debug build <debug-build>` of CPython 3.6)
.. _static-markers:
Available static markers Available static markers
------------------------ ------------------------

View file

@ -50,7 +50,9 @@ cannot be used with HMAC.
.. versionadded:: 3.7 .. versionadded:: 3.7
An HMAC object has the following methods: .. class:: HMAC
An HMAC object has the following methods:
.. method:: HMAC.update(msg) .. method:: HMAC.update(msg)

View file

@ -2351,6 +2351,9 @@ Customizing module attribute access
single: __dir__ (module attribute) single: __dir__ (module attribute)
single: __class__ (module attribute) single: __class__ (module attribute)
.. method:: module.__getattr__
module.__dir__
Special names ``__getattr__`` and ``__dir__`` can be also used to customize Special names ``__getattr__`` and ``__dir__`` can be also used to customize
access to module attributes. The ``__getattr__`` function at the module level access to module attributes. The ``__getattr__`` function at the module level
should accept one argument which is the name of an attribute and return the should accept one argument which is the name of an attribute and return the
@ -2364,6 +2367,8 @@ The ``__dir__`` function should accept no arguments, and return an iterable of
strings that represents the names accessible on module. If present, this strings that represents the names accessible on module. If present, this
function overrides the standard :func:`dir` search on a module. function overrides the standard :func:`dir` search on a module.
.. attribute:: module.__class__
For a more fine grained customization of the module behavior (setting For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the ``__class__`` attribute of attributes, properties, etc.), one can set the ``__class__`` attribute of
a module object to a subclass of :class:`types.ModuleType`. For example:: a module object to a subclass of :class:`types.ModuleType`. For example::

View file

@ -66,6 +66,5 @@ Doc/whatsnew/3.3.rst
Doc/whatsnew/3.4.rst Doc/whatsnew/3.4.rst
Doc/whatsnew/3.5.rst Doc/whatsnew/3.5.rst
Doc/whatsnew/3.6.rst Doc/whatsnew/3.6.rst
Doc/whatsnew/3.7.rst
Doc/whatsnew/3.8.rst Doc/whatsnew/3.8.rst
Doc/whatsnew/3.10.rst Doc/whatsnew/3.10.rst

View file

@ -320,9 +320,9 @@ effort will be made to add such support.
PEP 562: Customization of Access to Module Attributes PEP 562: Customization of Access to Module Attributes
----------------------------------------------------- -----------------------------------------------------
Python 3.7 allows defining :meth:`__getattr__` on modules and will call Python 3.7 allows defining :meth:`~module.__getattr__` on modules and will call
it whenever a module attribute is otherwise not found. Defining it whenever a module attribute is otherwise not found. Defining
:meth:`__dir__` on modules is now also allowed. :meth:`~module.__dir__` on modules is now also allowed.
A typical example of where this may be useful is module attribute deprecation A typical example of where this may be useful is module attribute deprecation
and lazy loading. and lazy loading.
@ -409,8 +409,8 @@ PEP 560: Core Support for ``typing`` module and Generic Types
Initially :pep:`484` was designed in such way that it would not introduce *any* Initially :pep:`484` was designed in such way that it would not introduce *any*
changes to the core CPython interpreter. Now type hints and the :mod:`typing` changes to the core CPython interpreter. Now type hints and the :mod:`typing`
module are extensively used by the community, so this restriction is removed. module are extensively used by the community, so this restriction is removed.
The PEP introduces two special methods :meth:`__class_getitem__` and The PEP introduces two special methods :meth:`~object.__class_getitem__` and
``__mro_entries__``, these methods are now used by most classes and special :meth:`~object.__mro_entries__`, these methods are now used by most classes and special
constructs in :mod:`typing`. As a result, the speed of various operations constructs in :mod:`typing`. As a result, the speed of various operations
with types increased up to 7 times, the generic types can be used without with types increased up to 7 times, the generic types can be used without
metaclass conflicts, and several long standing bugs in :mod:`typing` module are metaclass conflicts, and several long standing bugs in :mod:`typing` module are
@ -603,7 +603,7 @@ The new :mod:`importlib.resources` module provides several new APIs and one
new ABC for access to, opening, and reading *resources* inside packages. new ABC for access to, opening, and reading *resources* inside packages.
Resources are roughly similar to files inside packages, but they needn't Resources are roughly similar to files inside packages, but they needn't
be actual files on the physical file system. Module loaders can provide a be actual files on the physical file system. Module loaders can provide a
:meth:`get_resource_reader` function which returns :meth:`!get_resource_reader` function which returns
a :class:`importlib.abc.ResourceReader` instance to support this a :class:`importlib.abc.ResourceReader` instance to support this
new API. Built-in file path loaders and zip file loaders both support this. new API. Built-in file path loaders and zip file loaders both support this.
@ -910,9 +910,9 @@ which allows listing the names of properties which should not become
enum members. enum members.
(Contributed by Ethan Furman in :issue:`31801`.) (Contributed by Ethan Furman in :issue:`31801`.)
In Python 3.8, attempting to check for non-Enum objects in :class:`Enum` In Python 3.8, attempting to check for non-Enum objects in :class:`~enum.Enum`
classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly, classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly,
attempting to check for non-Flag objects in a :class:`Flag` member will attempting to check for non-Flag objects in a :class:`~enum.Flag` member will
raise :exc:`TypeError` (e.g. ``1 in Perm.RW``); currently, both operations raise :exc:`TypeError` (e.g. ``1 in Perm.RW``); currently, both operations
return :const:`False` instead and are deprecated. return :const:`False` instead and are deprecated.
(Contributed by Ethan Furman in :issue:`33217`.) (Contributed by Ethan Furman in :issue:`33217`.)
@ -969,7 +969,7 @@ uses the current working directory.
(Contributed by Stéphane Wirtel and Julien Palard in :issue:`28707`.) (Contributed by Stéphane Wirtel and Julien Palard in :issue:`28707`.)
The new :class:`ThreadingHTTPServer <http.server.ThreadingHTTPServer>` class The new :class:`ThreadingHTTPServer <http.server.ThreadingHTTPServer>` class
uses threads to handle requests using :class:`~socketserver.ThreadingMixin`. uses threads to handle requests using :class:`~socketserver.ThreadingMixIn`.
It is used when ``http.server`` is run with ``-m``. It is used when ``http.server`` is run with ``-m``.
(Contributed by Julien Palard in :issue:`31639`.) (Contributed by Julien Palard in :issue:`31639`.)
@ -1052,12 +1052,12 @@ support the loading of resources from packages. See also
lacks a spec. lacks a spec.
(Contributed by Garvit Khatri in :issue:`29851`.) (Contributed by Garvit Khatri in :issue:`29851`.)
:func:`importlib.find_spec` now raises :exc:`ModuleNotFoundError` instead of :func:`importlib.util.find_spec` now raises :exc:`ModuleNotFoundError` instead of
:exc:`AttributeError` if the specified parent module is not a package (i.e. :exc:`AttributeError` if the specified parent module is not a package (i.e.
lacks a ``__path__`` attribute). lacks a ``__path__`` attribute).
(Contributed by Milan Oberkirch in :issue:`30436`.) (Contributed by Milan Oberkirch in :issue:`30436`.)
The new :func:`importlib.source_hash` can be used to compute the hash of The new :func:`importlib.util.source_hash` can be used to compute the hash of
the passed source. A :ref:`hash-based .pyc file <whatsnew37-pep552>` the passed source. A :ref:`hash-based .pyc file <whatsnew37-pep552>`
embeds the value returned by this function. embeds the value returned by this function.
@ -1148,7 +1148,7 @@ running.
(Contributed by Antoine Pitrou in :issue:`30596`.) (Contributed by Antoine Pitrou in :issue:`30596`.)
The new :meth:`Process.kill() <multiprocessing.Process.kill>` method can The new :meth:`Process.kill() <multiprocessing.Process.kill>` method can
be used to terminate the process using the :data:`SIGKILL` signal on Unix. be used to terminate the process using the :data:`~signal.SIGKILL` signal on Unix.
(Contributed by Vitor Pereira in :issue:`30794`.) (Contributed by Vitor Pereira in :issue:`30794`.)
Non-daemonic threads created by :class:`~multiprocessing.Process` are now Non-daemonic threads created by :class:`~multiprocessing.Process` are now
@ -1280,9 +1280,10 @@ This function should be used instead of :func:`os.close` for better
compatibility across platforms. compatibility across platforms.
(Contributed by Christian Heimes in :issue:`32454`.) (Contributed by Christian Heimes in :issue:`32454`.)
The :mod:`socket` module now exposes the :const:`socket.TCP_CONGESTION` The :mod:`socket` module now exposes the :ref:`socket.TCP_CONGESTION
(Linux 2.6.13), :const:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37), and <socket-unix-constants>` (Linux 2.6.13), :ref:`socket.TCP_USER_TIMEOUT
:const:`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constants. <socket-unix-constants>` (Linux 2.6.37), and :ref:`socket.TCP_NOTSENT_LOWAT
<socket-unix-constants>` (Linux 3.12) constants.
(Contributed by Omar Sandoval in :issue:`26273` and (Contributed by Omar Sandoval in :issue:`26273` and
Nathaniel J. Smith in :issue:`29728`.) Nathaniel J. Smith in :issue:`29728`.)
@ -1298,11 +1299,14 @@ by default.
socketserver socketserver
------------ ------------
:meth:`socketserver.ThreadingMixIn.server_close` now waits until all non-daemon :meth:`socketserver.ThreadingMixIn.server_close
threads complete. :meth:`socketserver.ForkingMixIn.server_close` now waits <socketserver.BaseServer.server_close>` now waits until all non-daemon
threads complete. :meth:`socketserver.ForkingMixIn.server_close
<socketserver.BaseServer.server_close>` now waits
until all child processes complete. until all child processes complete.
Add a new :attr:`socketserver.ForkingMixIn.block_on_close` class attribute to Add a new :attr:`socketserver.ForkingMixIn.block_on_close
<socketserver.ThreadingMixIn.block_on_close>` class attribute to
:class:`socketserver.ForkingMixIn` and :class:`socketserver.ThreadingMixIn` :class:`socketserver.ForkingMixIn` and :class:`socketserver.ThreadingMixIn`
classes. Set the class attribute to ``False`` to get the pre-3.7 behaviour. classes. Set the class attribute to ``False`` to get the pre-3.7 behaviour.
@ -1323,7 +1327,7 @@ ssl
--- ---
The :mod:`ssl` module now uses OpenSSL's builtin API instead of The :mod:`ssl` module now uses OpenSSL's builtin API instead of
:func:`~ssl.match_hostname` to check a host name or an IP address. Values :func:`!match_hostname` to check a host name or an IP address. Values
are validated during TLS handshake. Any certificate validation error are validated during TLS handshake. Any certificate validation error
including failing the host name check now raises including failing the host name check now raises
:exc:`~ssl.SSLCertVerificationError` and aborts the handshake with a proper :exc:`~ssl.SSLCertVerificationError` and aborts the handshake with a proper
@ -1341,7 +1345,7 @@ Host name validation can be customized with
The ``ssl`` module no longer sends IP addresses in SNI TLS extension. The ``ssl`` module no longer sends IP addresses in SNI TLS extension.
(Contributed by Christian Heimes in :issue:`32185`.) (Contributed by Christian Heimes in :issue:`32185`.)
:func:`~ssl.match_hostname` no longer supports partial wildcards like :func:`!match_hostname` no longer supports partial wildcards like
``www*.example.org``. ``www*.example.org``.
(Contributed by Mandeep Singh in :issue:`23033` and Christian Heimes in (Contributed by Mandeep Singh in :issue:`23033` and Christian Heimes in
:issue:`31399`.) :issue:`31399`.)
@ -1438,7 +1442,7 @@ The new :func:`sys.get_coroutine_origin_tracking_depth` function returns
the current coroutine origin tracking depth, as set by the current coroutine origin tracking depth, as set by
the new :func:`sys.set_coroutine_origin_tracking_depth`. :mod:`asyncio` the new :func:`sys.set_coroutine_origin_tracking_depth`. :mod:`asyncio`
has been converted to use this new API instead of has been converted to use this new API instead of
the deprecated :func:`sys.set_coroutine_wrapper`. the deprecated :func:`!sys.set_coroutine_wrapper`.
(Contributed by Nathaniel J. Smith in :issue:`32591`.) (Contributed by Nathaniel J. Smith in :issue:`32591`.)
@ -1615,7 +1619,7 @@ external entities by default.
xml.etree xml.etree
--------- ---------
:ref:`ElementPath <elementtree-xpath>` predicates in the :meth:`find` :ref:`ElementPath <elementtree-xpath>` predicates in the :meth:`!find`
methods can now compare text of the current node with ``[. = "text"]``, methods can now compare text of the current node with ``[. = "text"]``,
not only text in children. Predicates also allow adding spaces for not only text in children. Predicates also allow adding spaces for
better readability. (Contributed by Stefan Behnel in :issue:`31648`.) better readability. (Contributed by Stefan Behnel in :issue:`31648`.)
@ -1624,7 +1628,7 @@ better readability. (Contributed by Stefan Behnel in :issue:`31648`.)
xmlrpc.server xmlrpc.server
------------- -------------
:meth:`SimpleXMLRPCDispatcher.register_function <xmlrpc.server.SimpleXMLRPCDispatcher>` :meth:`!SimpleXMLRPCDispatcher.register_function`
can now be used as a decorator. (Contributed by Xiang Zhang in can now be used as a decorator. (Contributed by Xiang Zhang in
:issue:`7769`.) :issue:`7769`.)
@ -1682,15 +1686,15 @@ The :mod:`tracemalloc` now exposes a C API through the new
functions. functions.
(Contributed by Victor Stinner in :issue:`30054`.) (Contributed by Victor Stinner in :issue:`30054`.)
The new :c:func:`import__find__load__start` and The new :ref:`import__find__load__start <static-markers>` and
:c:func:`import__find__load__done` static markers can be used to trace :ref:`import__find__load__done <static-markers>` static markers can be used
module imports. to trace module imports.
(Contributed by Christian Heimes in :issue:`31574`.) (Contributed by Christian Heimes in :issue:`31574`.)
The fields :c:member:`!name` and :c:member:`!doc` of structures The fields :c:member:`!name` and :c:member:`!doc` of structures
:c:type:`PyMemberDef`, :c:type:`PyGetSetDef`, :c:type:`PyMemberDef`, :c:type:`PyGetSetDef`,
:c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`, :c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`,
and :c:struct:`wrapperbase` are now of type ``const char *`` rather of and :c:struct:`!wrapperbase` are now of type ``const char *`` rather of
``char *``. (Contributed by Serhiy Storchaka in :issue:`28761`.) ``char *``. (Contributed by Serhiy Storchaka in :issue:`28761`.)
The result of :c:func:`PyUnicode_AsUTF8AndSize` and :c:func:`PyUnicode_AsUTF8` The result of :c:func:`PyUnicode_AsUTF8AndSize` and :c:func:`PyUnicode_AsUTF8`
@ -1719,8 +1723,8 @@ Added C API support for timezones with timezone constructors
and access to the UTC singleton with :c:data:`PyDateTime_TimeZone_UTC`. and access to the UTC singleton with :c:data:`PyDateTime_TimeZone_UTC`.
Contributed by Paul Ganssle in :issue:`10381`. Contributed by Paul Ganssle in :issue:`10381`.
The type of results of :c:func:`PyThread_start_new_thread` and The type of results of :c:func:`!PyThread_start_new_thread` and
:c:func:`PyThread_get_thread_ident`, and the *id* parameter of :c:func:`!PyThread_get_thread_ident`, and the *id* parameter of
:c:func:`PyThreadState_SetAsyncExc` changed from :c:expr:`long` to :c:func:`PyThreadState_SetAsyncExc` changed from :c:expr:`long` to
:c:expr:`unsigned long`. :c:expr:`unsigned long`.
(Contributed by Serhiy Storchaka in :issue:`6532`.) (Contributed by Serhiy Storchaka in :issue:`6532`.)
@ -1847,8 +1851,8 @@ make the creation of named tuples 4 to 6 times faster.
(Contributed by Jelle Zijlstra with further improvements by INADA Naoki, (Contributed by Jelle Zijlstra with further improvements by INADA Naoki,
Serhiy Storchaka, and Raymond Hettinger in :issue:`28638`.) Serhiy Storchaka, and Raymond Hettinger in :issue:`28638`.)
:meth:`date.fromordinal` and :meth:`date.fromtimestamp` are now up to :meth:`datetime.date.fromordinal` and :meth:`datetime.date.fromtimestamp`
30% faster in the common case. are now up to 30% faster in the common case.
(Contributed by Paul Ganssle in :issue:`32403`.) (Contributed by Paul Ganssle in :issue:`32403`.)
The :func:`os.fwalk` function is now up to 2 times faster thanks to The :func:`os.fwalk` function is now up to 2 times faster thanks to
@ -1997,9 +2001,9 @@ modes (this will be an error in future Python releases).
enum enum
---- ----
In Python 3.8, attempting to check for non-Enum objects in :class:`Enum` In Python 3.8, attempting to check for non-Enum objects in :class:`~enum.Enum`
classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly, classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly,
attempting to check for non-Flag objects in a :class:`Flag` member will attempting to check for non-Flag objects in a :class:`~enum.Flag` member will
raise :exc:`TypeError` (e.g. ``1 in Perm.RW``); currently, both operations raise :exc:`TypeError` (e.g. ``1 in Perm.RW``); currently, both operations
return :const:`False` instead. return :const:`False` instead.
(Contributed by Ethan Furman in :issue:`33217`.) (Contributed by Ethan Furman in :issue:`33217`.)
@ -2034,14 +2038,14 @@ favour of :class:`importlib.abc.ResourceReader`.
locale locale
------ ------
:func:`locale.format` has been deprecated, use :meth:`locale.format_string` :func:`!locale.format` has been deprecated, use :meth:`locale.format_string`
instead. (Contributed by Garvit in :issue:`10379`.) instead. (Contributed by Garvit in :issue:`10379`.)
macpath macpath
------- -------
The :mod:`macpath` is now deprecated and will be removed in Python 3.8. The :mod:`!macpath` is now deprecated and will be removed in Python 3.8.
(Contributed by Chi Hsuan Yen in :issue:`9850`.) (Contributed by Chi Hsuan Yen in :issue:`9850`.)
@ -2066,7 +2070,7 @@ if the passed argument is larger than 16 bits, an exception will be raised.
ssl ssl
--- ---
:func:`ssl.wrap_socket` is deprecated. Use :func:`!ssl.wrap_socket` is deprecated. Use
:meth:`ssl.SSLContext.wrap_socket` instead. :meth:`ssl.SSLContext.wrap_socket` instead.
(Contributed by Christian Heimes in :issue:`28124`.) (Contributed by Christian Heimes in :issue:`28124`.)
@ -2082,8 +2086,8 @@ Use :func:`!sunau.open` instead.
sys sys
--- ---
Deprecated :func:`sys.set_coroutine_wrapper` and Deprecated :func:`!sys.set_coroutine_wrapper` and
:func:`sys.get_coroutine_wrapper`. :func:`!sys.get_coroutine_wrapper`.
The undocumented ``sys.callstats()`` function has been deprecated and The undocumented ``sys.callstats()`` function has been deprecated and
will be removed in a future Python version. will be removed in a future Python version.
@ -2093,7 +2097,7 @@ will be removed in a future Python version.
wave wave
---- ----
:func:`wave.openfp` has been deprecated and will be removed in Python 3.9. :func:`!wave.openfp` has been deprecated and will be removed in Python 3.9.
Use :func:`wave.open` instead. Use :func:`wave.open` instead.
(Contributed by Brian Curtin in :issue:`31985`.) (Contributed by Brian Curtin in :issue:`31985`.)
@ -2173,8 +2177,8 @@ The following features and APIs have been removed from Python 3.7:
* Removed previously deprecated in Python 2.4 classes ``Plist``, ``Dict`` and * Removed previously deprecated in Python 2.4 classes ``Plist``, ``Dict`` and
``_InternalDict`` in the :mod:`plistlib` module. Dict values in the result ``_InternalDict`` in the :mod:`plistlib` module. Dict values in the result
of functions :func:`~plistlib.readPlist` and of functions :func:`!readPlist` and
:func:`~plistlib.readPlistFromBytes` are now normal dicts. You no longer :func:`!readPlistFromBytes` are now normal dicts. You no longer
can use attribute access to access items of these dictionaries. can use attribute access to access items of these dictionaries.
* The ``asyncio.windows_utils.socketpair()`` function has been * The ``asyncio.windows_utils.socketpair()`` function has been
@ -2191,7 +2195,7 @@ The following features and APIs have been removed from Python 3.7:
* Direct instantiation of :class:`ssl.SSLSocket` and :class:`ssl.SSLObject` * Direct instantiation of :class:`ssl.SSLSocket` and :class:`ssl.SSLObject`
objects is now prohibited. The constructors were never documented, tested, objects is now prohibited. The constructors were never documented, tested,
or designed as public constructors. Users were supposed to use or designed as public constructors. Users were supposed to use
:func:`ssl.wrap_socket` or :class:`ssl.SSLContext`. :func:`!ssl.wrap_socket` or :class:`ssl.SSLContext`.
(Contributed by Christian Heimes in :issue:`32951`.) (Contributed by Christian Heimes in :issue:`32951`.)
* The unused ``distutils`` ``install_misc`` command has been removed. * The unused ``distutils`` ``install_misc`` command has been removed.
@ -2275,15 +2279,18 @@ Changes in Python Behavior
Changes in the Python API Changes in the Python API
------------------------- -------------------------
* :meth:`socketserver.ThreadingMixIn.server_close` now waits until all * :meth:`socketserver.ThreadingMixIn.server_close
<socketserver.BaseServer.server_close>` now waits until all
non-daemon threads complete. Set the new non-daemon threads complete. Set the new
:attr:`socketserver.ThreadingMixIn.block_on_close` class attribute to :attr:`socketserver.ThreadingMixIn.block_on_close` class attribute to
``False`` to get the pre-3.7 behaviour. ``False`` to get the pre-3.7 behaviour.
(Contributed by Victor Stinner in :issue:`31233` and :issue:`33540`.) (Contributed by Victor Stinner in :issue:`31233` and :issue:`33540`.)
* :meth:`socketserver.ForkingMixIn.server_close` now waits until all * :meth:`socketserver.ForkingMixIn.server_close
<socketserver.BaseServer.server_close>` now waits until all
child processes complete. Set the new child processes complete. Set the new
:attr:`socketserver.ForkingMixIn.block_on_close` class attribute to ``False`` :attr:`socketserver.ForkingMixIn.block_on_close
<socketserver.ThreadingMixIn.block_on_close>` class attribute to ``False``
to get the pre-3.7 behaviour. to get the pre-3.7 behaviour.
(Contributed by Victor Stinner in :issue:`31151` and :issue:`33540`.) (Contributed by Victor Stinner in :issue:`31151` and :issue:`33540`.)