Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b0069f1

Browse files
miss-islingtonAA-Turner
andauthored
[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 dd86fb4) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent da3850c commit b0069f1

File tree

5 files changed

+61
-46
lines changed

5 files changed

+61
-46
lines changed

‎Doc/howto/instrumentation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ should instead read:
269269
(assuming a :ref:`debug build <debug-build>` of CPython 3.6)
270270

271271

272+
.. _static-markers:
273+
272274
Available static markers
273275
------------------------
274276

‎Doc/library/hmac.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ cannot be used with HMAC.
5050
.. versionadded:: 3.7
5151

5252

53-
An HMAC object has the following methods:
53+
.. class:: HMAC
54+
55+
An HMAC object has the following methods:
5456

5557
.. method:: HMAC.update(msg)
5658

‎Doc/reference/datamodel.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,9 @@ Customizing module attribute access
23512351
single: __dir__ (module attribute)
23522352
single: __class__ (module attribute)
23532353

2354+
.. method:: module.__getattr__
2355+
module.__dir__
2356+
23542357
Special names ``__getattr__`` and ``__dir__`` can be also used to customize
23552358
access to module attributes. The ``__getattr__`` function at the module level
23562359
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
23642367
strings that represents the names accessible on module. If present, this
23652368
function overrides the standard :func:`dir` search on a module.
23662369

2370+
.. attribute:: module.__class__
2371+
23672372
For a more fine grained customization of the module behavior (setting
23682373
attributes, properties, etc.), one can set the ``__class__`` attribute of
23692374
a module object to a subclass of :class:`types.ModuleType`. For example::

‎Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,5 @@ Doc/whatsnew/3.3.rst
6666
Doc/whatsnew/3.4.rst
6767
Doc/whatsnew/3.5.rst
6868
Doc/whatsnew/3.6.rst
69-
Doc/whatsnew/3.7.rst
7069
Doc/whatsnew/3.8.rst
7170
Doc/whatsnew/3.10.rst

‎Doc/whatsnew/3.7.rst

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,9 @@ effort will be made to add such support.
320320
PEP 562: Customization of Access to Module Attributes
321321
-----------------------------------------------------
322322

323-
Python 3.7 allows defining :meth:`__getattr__` on modules and will call
323+
Python 3.7 allows defining :meth:`~module.__getattr__` on modules and will call
324324
it whenever a module attribute is otherwise not found. Defining
325-
:meth:`__dir__` on modules is now also allowed.
325+
:meth:`~module.__dir__` on modules is now also allowed.
326326

327327
A typical example of where this may be useful is module attribute deprecation
328328
and lazy loading.
@@ -409,8 +409,8 @@ PEP 560: Core Support for ``typing`` module and Generic Types
409409
Initially :pep:`484` was designed in such way that it would not introduce *any*
410410
changes to the core CPython interpreter. Now type hints and the :mod:`typing`
411411
module are extensively used by the community, so this restriction is removed.
412-
The PEP introduces two special methods :meth:`__class_getitem__` and
413-
``__mro_entries__``, these methods are now used by most classes and special
412+
The PEP introduces two special methods :meth:`~object.__class_getitem__` and
413+
:meth:`~object.__mro_entries__`, these methods are now used by most classes and special
414414
constructs in :mod:`typing`. As a result, the speed of various operations
415415
with types increased up to 7 times, the generic types can be used without
416416
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
603603
new ABC for access to, opening, and reading *resources* inside packages.
604604
Resources are roughly similar to files inside packages, but they needn't
605605
be actual files on the physical file system. Module loaders can provide a
606-
:meth:`get_resource_reader` function which returns
606+
:meth:`!get_resource_reader` function which returns
607607
a :class:`importlib.abc.ResourceReader` instance to support this
608608
new API. Built-in file path loaders and zip file loaders both support this.
609609

@@ -910,9 +910,9 @@ which allows listing the names of properties which should not become
910910
enum members.
911911
(Contributed by Ethan Furman in :issue:`31801`.)
912912

913-
In Python 3.8, attempting to check for non-Enum objects in :class:`Enum`
913+
In Python 3.8, attempting to check for non-Enum objects in :class:`~enum.Enum`
914914
classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly,
915-
attempting to check for non-Flag objects in a :class:`Flag` member will
915+
attempting to check for non-Flag objects in a :class:`~enum.Flag` member will
916916
raise :exc:`TypeError` (e.g. ``1 in Perm.RW``); currently, both operations
917917
return :const:`False` instead and are deprecated.
918918
(Contributed by Ethan Furman in :issue:`33217`.)
@@ -969,7 +969,7 @@ uses the current working directory.
969969
(Contributed by Stéphane Wirtel and Julien Palard in :issue:`28707`.)
970970

971971
The new :class:`ThreadingHTTPServer <http.server.ThreadingHTTPServer>` class
972-
uses threads to handle requests using :class:`~socketserver.ThreadingMixin`.
972+
uses threads to handle requests using :class:`~socketserver.ThreadingMixIn`.
973973
It is used when ``http.server`` is run with ``-m``.
974974
(Contributed by Julien Palard in :issue:`31639`.)
975975

@@ -1052,12 +1052,12 @@ support the loading of resources from packages. See also
10521052
lacks a spec.
10531053
(Contributed by Garvit Khatri in :issue:`29851`.)
10541054

1055-
:func:`importlib.find_spec` now raises :exc:`ModuleNotFoundError` instead of
1055+
:func:`importlib.util.find_spec` now raises :exc:`ModuleNotFoundError` instead of
10561056
:exc:`AttributeError` if the specified parent module is not a package (i.e.
10571057
lacks a ``__path__`` attribute).
10581058
(Contributed by Milan Oberkirch in :issue:`30436`.)
10591059

1060-
The new :func:`importlib.source_hash` can be used to compute the hash of
1060+
The new :func:`importlib.util.source_hash` can be used to compute the hash of
10611061
the passed source. A :ref:`hash-based .pyc file <whatsnew37-pep552>`
10621062
embeds the value returned by this function.
10631063

@@ -1148,7 +1148,7 @@ running.
11481148
(Contributed by Antoine Pitrou in :issue:`30596`.)
11491149

11501150
The new :meth:`Process.kill() <multiprocessing.Process.kill>` method can
1151-
be used to terminate the process using the :data:`SIGKILL` signal on Unix.
1151+
be used to terminate the process using the :data:`~signal.SIGKILL` signal on Unix.
11521152
(Contributed by Vitor Pereira in :issue:`30794`.)
11531153

11541154
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
12801280
compatibility across platforms.
12811281
(Contributed by Christian Heimes in :issue:`32454`.)
12821282

1283-
The :mod:`socket` module now exposes the :const:`socket.TCP_CONGESTION`
1284-
(Linux 2.6.13), :const:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37), and
1285-
:const:`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constants.
1283+
The :mod:`socket` module now exposes the :ref:`socket.TCP_CONGESTION
1284+
<socket-unix-constants>` (Linux 2.6.13), :ref:`socket.TCP_USER_TIMEOUT
1285+
<socket-unix-constants>` (Linux 2.6.37), and :ref:`socket.TCP_NOTSENT_LOWAT
1286+
<socket-unix-constants>` (Linux 3.12) constants.
12861287
(Contributed by Omar Sandoval in :issue:`26273` and
12871288
Nathaniel J. Smith in :issue:`29728`.)
12881289

@@ -1298,11 +1299,14 @@ by default.
12981299
socketserver
12991300
------------
13001301

1301-
:meth:`socketserver.ThreadingMixIn.server_close` now waits until all non-daemon
1302-
threads complete. :meth:`socketserver.ForkingMixIn.server_close` now waits
1302+
:meth:`socketserver.ThreadingMixIn.server_close
1303+
<socketserver.BaseServer.server_close>` now waits until all non-daemon
1304+
threads complete. :meth:`socketserver.ForkingMixIn.server_close
1305+
<socketserver.BaseServer.server_close>` now waits
13031306
until all child processes complete.
13041307

1305-
Add a new :attr:`socketserver.ForkingMixIn.block_on_close` class attribute to
1308+
Add a new :attr:`socketserver.ForkingMixIn.block_on_close
1309+
<socketserver.ThreadingMixIn.block_on_close>` class attribute to
13061310
:class:`socketserver.ForkingMixIn` and :class:`socketserver.ThreadingMixIn`
13071311
classes. Set the class attribute to ``False`` to get the pre-3.7 behaviour.
13081312

@@ -1323,7 +1327,7 @@ ssl
13231327
---
13241328

13251329
The :mod:`ssl` module now uses OpenSSL's builtin API instead of
1326-
:func:`~ssl.match_hostname` to check a host name or an IP address. Values
1330+
:func:`!match_hostname` to check a host name or an IP address. Values
13271331
are validated during TLS handshake. Any certificate validation error
13281332
including failing the host name check now raises
13291333
:exc:`~ssl.SSLCertVerificationError` and aborts the handshake with a proper
@@ -1341,7 +1345,7 @@ Host name validation can be customized with
13411345
The ``ssl`` module no longer sends IP addresses in SNI TLS extension.
13421346
(Contributed by Christian Heimes in :issue:`32185`.)
13431347

1344-
:func:`~ssl.match_hostname` no longer supports partial wildcards like
1348+
:func:`!match_hostname` no longer supports partial wildcards like
13451349
``www*.example.org``.
13461350
(Contributed by Mandeep Singh in :issue:`23033` and Christian Heimes in
13471351
:issue:`31399`.)
@@ -1438,7 +1442,7 @@ The new :func:`sys.get_coroutine_origin_tracking_depth` function returns
14381442
the current coroutine origin tracking depth, as set by
14391443
the new :func:`sys.set_coroutine_origin_tracking_depth`. :mod:`asyncio`
14401444
has been converted to use this new API instead of
1441-
the deprecated :func:`sys.set_coroutine_wrapper`.
1445+
the deprecated :func:`!sys.set_coroutine_wrapper`.
14421446
(Contributed by Nathaniel J. Smith in :issue:`32591`.)
14431447

14441448

@@ -1615,7 +1619,7 @@ external entities by default.
16151619
xml.etree
16161620
---------
16171621

1618-
:ref:`ElementPath <elementtree-xpath>` predicates in the :meth:`find`
1622+
:ref:`ElementPath <elementtree-xpath>` predicates in the :meth:`!find`
16191623
methods can now compare text of the current node with ``[. = "text"]``,
16201624
not only text in children. Predicates also allow adding spaces for
16211625
better readability. (Contributed by Stefan Behnel in :issue:`31648`.)
@@ -1624,7 +1628,7 @@ better readability. (Contributed by Stefan Behnel in :issue:`31648`.)
16241628
xmlrpc.server
16251629
-------------
16261630

1627-
:meth:`SimpleXMLRPCDispatcher.register_function <xmlrpc.server.SimpleXMLRPCDispatcher>`
1631+
:meth:`!SimpleXMLRPCDispatcher.register_function`
16281632
can now be used as a decorator. (Contributed by Xiang Zhang in
16291633
:issue:`7769`.)
16301634

@@ -1682,15 +1686,15 @@ The :mod:`tracemalloc` now exposes a C API through the new
16821686
functions.
16831687
(Contributed by Victor Stinner in :issue:`30054`.)
16841688

1685-
The new :c:func:`import__find__load__start` and
1686-
:c:func:`import__find__load__done` static markers can be used to trace
1687-
module imports.
1689+
The new :ref:`import__find__load__start<static-markers>` and
1690+
:ref:`import__find__load__done<static-markers>` static markers can be used
1691+
to trace module imports.
16881692
(Contributed by Christian Heimes in :issue:`31574`.)
16891693

16901694
The fields :c:member:`!name` and :c:member:`!doc` of structures
16911695
:c:type:`PyMemberDef`, :c:type:`PyGetSetDef`,
16921696
:c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`,
1693-
and :c:struct:`wrapperbase` are now of type ``const char *`` rather of
1697+
and :c:struct:`!wrapperbase` are now of type ``const char *`` rather of
16941698
``char *``. (Contributed by Serhiy Storchaka in :issue:`28761`.)
16951699

16961700
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
17191723
and access to the UTC singleton with :c:data:`PyDateTime_TimeZone_UTC`.
17201724
Contributed by Paul Ganssle in :issue:`10381`.
17211725

1722-
The type of results of :c:func:`PyThread_start_new_thread` and
1723-
:c:func:`PyThread_get_thread_ident`, and the *id* parameter of
1726+
The type of results of :c:func:`!PyThread_start_new_thread` and
1727+
:c:func:`!PyThread_get_thread_ident`, and the *id* parameter of
17241728
:c:func:`PyThreadState_SetAsyncExc` changed from :c:expr:`long` to
17251729
:c:expr:`unsigned long`.
17261730
(Contributed by Serhiy Storchaka in :issue:`6532`.)
@@ -1847,8 +1851,8 @@ make the creation of named tuples 4 to 6 times faster.
18471851
(Contributed by Jelle Zijlstra with further improvements by INADA Naoki,
18481852
Serhiy Storchaka, and Raymond Hettinger in :issue:`28638`.)
18491853

1850-
:meth:`date.fromordinal` and :meth:`date.fromtimestamp` are now up to
1851-
30% faster in the common case.
1854+
:meth:`datetime.date.fromordinal` and :meth:`datetime.date.fromtimestamp`
1855+
are now up to 30% faster in the common case.
18521856
(Contributed by Paul Ganssle in :issue:`32403`.)
18531857

18541858
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).
19972001
enum
19982002
----
19992003

2000-
In Python 3.8, attempting to check for non-Enum objects in :class:`Enum`
2004+
In Python 3.8, attempting to check for non-Enum objects in :class:`~enum.Enum`
20012005
classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly,
2002-
attempting to check for non-Flag objects in a :class:`Flag` member will
2006+
attempting to check for non-Flag objects in a :class:`~enum.Flag` member will
20032007
raise :exc:`TypeError` (e.g. ``1 in Perm.RW``); currently, both operations
20042008
return :const:`False` instead.
20052009
(Contributed by Ethan Furman in :issue:`33217`.)
@@ -2034,14 +2038,14 @@ favour of :class:`importlib.abc.ResourceReader`.
20342038
locale
20352039
------
20362040

2037-
:func:`locale.format` has been deprecated, use :meth:`locale.format_string`
2041+
:func:`!locale.format` has been deprecated, use :meth:`locale.format_string`
20382042
instead. (Contributed by Garvit in :issue:`10379`.)
20392043

20402044

20412045
macpath
20422046
-------
20432047

2044-
The :mod:`macpath` is now deprecated and will be removed in Python 3.8.
2048+
The :mod:`!macpath` is now deprecated and will be removed in Python 3.8.
20452049
(Contributed by Chi Hsuan Yen in :issue:`9850`.)
20462050

20472051

@@ -2066,7 +2070,7 @@ if the passed argument is larger than 16 bits, an exception will be raised.
20662070
ssl
20672071
---
20682072

2069-
:func:`ssl.wrap_socket` is deprecated. Use
2073+
:func:`!ssl.wrap_socket` is deprecated. Use
20702074
:meth:`ssl.SSLContext.wrap_socket` instead.
20712075
(Contributed by Christian Heimes in :issue:`28124`.)
20722076

@@ -2082,8 +2086,8 @@ Use :func:`!sunau.open` instead.
20822086
sys
20832087
---
20842088

2085-
Deprecated :func:`sys.set_coroutine_wrapper` and
2086-
:func:`sys.get_coroutine_wrapper`.
2089+
Deprecated :func:`!sys.set_coroutine_wrapper` and
2090+
:func:`!sys.get_coroutine_wrapper`.
20872091

20882092
The undocumented ``sys.callstats()`` function has been deprecated and
20892093
will be removed in a future Python version.
@@ -2093,7 +2097,7 @@ will be removed in a future Python version.
20932097
wave
20942098
----
20952099

2096-
:func:`wave.openfp` has been deprecated and will be removed in Python 3.9.
2100+
:func:`!wave.openfp` has been deprecated and will be removed in Python 3.9.
20972101
Use :func:`wave.open` instead.
20982102
(Contributed by Brian Curtin in :issue:`31985`.)
20992103

@@ -2173,8 +2177,8 @@ The following features and APIs have been removed from Python 3.7:
21732177

21742178
* Removed previously deprecated in Python 2.4 classes ``Plist``, ``Dict`` and
21752179
``_InternalDict`` in the :mod:`plistlib` module. Dict values in the result
2176-
of functions :func:`~plistlib.readPlist` and
2177-
:func:`~plistlib.readPlistFromBytes` are now normal dicts. You no longer
2180+
of functions :func:`!readPlist` and
2181+
:func:`!readPlistFromBytes` are now normal dicts. You no longer
21782182
can use attribute access to access items of these dictionaries.
21792183

21802184
* The ``asyncio.windows_utils.socketpair()`` function has been
@@ -2191,7 +2195,7 @@ The following features and APIs have been removed from Python 3.7:
21912195
* Direct instantiation of :class:`ssl.SSLSocket` and :class:`ssl.SSLObject`
21922196
objects is now prohibited. The constructors were never documented, tested,
21932197
or designed as public constructors. Users were supposed to use
2194-
:func:`ssl.wrap_socket` or :class:`ssl.SSLContext`.
2198+
:func:`!ssl.wrap_socket` or :class:`ssl.SSLContext`.
21952199
(Contributed by Christian Heimes in :issue:`32951`.)
21962200

21972201
* The unused ``distutils`` ``install_misc`` command has been removed.
@@ -2275,15 +2279,18 @@ Changes in Python Behavior
22752279
Changes in the Python API
22762280
-------------------------
22772281

2278-
* :meth:`socketserver.ThreadingMixIn.server_close` now waits until all
2282+
* :meth:`socketserver.ThreadingMixIn.server_close
2283+
<socketserver.BaseServer.server_close>` now waits until all
22792284
non-daemon threads complete. Set the new
22802285
:attr:`socketserver.ThreadingMixIn.block_on_close` class attribute to
22812286
``False`` to get the pre-3.7 behaviour.
22822287
(Contributed by Victor Stinner in :issue:`31233` and :issue:`33540`.)
22832288

2284-
* :meth:`socketserver.ForkingMixIn.server_close` now waits until all
2289+
* :meth:`socketserver.ForkingMixIn.server_close
2290+
<socketserver.BaseServer.server_close>` now waits until all
22852291
child processes complete. Set the new
2286-
:attr:`socketserver.ForkingMixIn.block_on_close` class attribute to ``False``
2292+
:attr:`socketserver.ForkingMixIn.block_on_close
2293+
<socketserver.ThreadingMixIn.block_on_close>` class attribute to ``False``
22872294
to get the pre-3.7 behaviour.
22882295
(Contributed by Victor Stinner in :issue:`31151` and :issue:`33540`.)
22892296

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /