@@ -320,9 +320,9 @@ effort will be made to add such support.
320320PEP 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
324324it 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
327327A typical example of where this may be useful is module attribute deprecation
328328and lazy loading.
@@ -409,8 +409,8 @@ PEP 560: Core Support for ``typing`` module and Generic Types
409409Initially :pep: `484 ` was designed in such way that it would not introduce *any *
410410changes to the core CPython interpreter. Now type hints and the :mod: `typing `
411411module 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
414414constructs in :mod: `typing `. As a result, the speed of various operations
415415with types increased up to 7 times, the generic types can be used without
416416metaclass 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
603603new ABC for access to, opening, and reading *resources * inside packages.
604604Resources are roughly similar to files inside packages, but they needn't
605605be 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
607607a :class: `importlib.abc.ResourceReader ` instance to support this
608608new 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
910910enum 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 `
914914classes 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
916916raise :exc: `TypeError ` (e.g. ``1 in Perm.RW ``); currently, both operations
917917return :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
971971The 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 `.
973973It 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
10521052lacks 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.
10571057lacks 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
10611061the passed source. A :ref: `hash-based .pyc file <whatsnew37-pep552 >`
10621062embeds the value returned by this function.
10631063
@@ -1148,7 +1148,7 @@ running.
11481148(Contributed by Antoine Pitrou in :issue: `30596 `.)
11491149
11501150The 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
11541154Non-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
12801280compatibility 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
12871288Nathaniel J. Smith in :issue: `29728 `.)
12881289
@@ -1298,11 +1299,14 @@ by default.
12981299socketserver
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
13031306until 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 `
13071311classes. Set the class attribute to ``False `` to get the pre-3.7 behaviour.
13081312
@@ -1323,7 +1327,7 @@ ssl
13231327---
13241328
13251329The :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
13271331are validated during TLS handshake. Any certificate validation error
13281332including 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
13411345The ``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
14381442the current coroutine origin tracking depth, as set by
14391443the new :func: `sys.set_coroutine_origin_tracking_depth `. :mod: `asyncio `
14401444has 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.
16151619xml.etree
16161620---------
16171621
1618- :ref: `ElementPath <elementtree-xpath >` predicates in the :meth: `find `
1622+ :ref: `ElementPath <elementtree-xpath >` predicates in the :meth: `! find `
16191623methods can now compare text of the current node with ``[. = "text"] ``,
16201624not only text in children. Predicates also allow adding spaces for
16211625better readability. (Contributed by Stefan Behnel in :issue: `31648 `.)
@@ -1624,7 +1628,7 @@ better readability. (Contributed by Stefan Behnel in :issue:`31648`.)
16241628xmlrpc.server
16251629-------------
16261630
1627- :meth: `SimpleXMLRPCDispatcher.register_function <xmlrpc.server.SimpleXMLRPCDispatcher> `
1631+ :meth: `! SimpleXMLRPCDispatcher.register_function `
16281632can 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
16821686functions.
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
16901694The 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
16961700The result of :c:func: `PyUnicode_AsUTF8AndSize ` and :c:func: `PyUnicode_AsUTF8 `
@@ -1719,8 +1723,8 @@ Added C API support for timezones with timezone constructors
17191723and access to the UTC singleton with :c:data: `PyDateTime_TimeZone_UTC `.
17201724Contributed 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,
18481852Serhiy 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
18541858The :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).
19972001enum
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 `
20012005classes 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
20032007raise :exc: `TypeError ` (e.g. ``1 in Perm.RW ``); currently, both operations
20042008return :const: `False ` instead.
20052009(Contributed by Ethan Furman in :issue: `33217 `.)
@@ -2034,14 +2038,14 @@ favour of :class:`importlib.abc.ResourceReader`.
20342038locale
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 `
20382042instead. (Contributed by Garvit in :issue: `10379 `.)
20392043
20402044
20412045macpath
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.
20662070ssl
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.
20822086sys
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
20882092The undocumented ``sys.callstats() `` function has been deprecated and
20892093will be removed in a future Python version.
@@ -2093,7 +2097,7 @@ will be removed in a future Python version.
20932097wave
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.
20972101Use :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
22752279Changes 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