@@ -320,9 +320,9 @@ effort will be made to add such support.
320
320
PEP 562: Customization of Access to Module Attributes
321
321
-----------------------------------------------------
322
322
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
324
324
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.
326
326
327
327
A typical example of where this may be useful is module attribute deprecation
328
328
and lazy loading.
@@ -409,8 +409,8 @@ PEP 560: Core Support for ``typing`` module and Generic Types
409
409
Initially :pep: `484 ` was designed in such way that it would not introduce *any *
410
410
changes to the core CPython interpreter. Now type hints and the :mod: `typing `
411
411
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
414
414
constructs in :mod: `typing `. As a result, the speed of various operations
415
415
with types increased up to 7 times, the generic types can be used without
416
416
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
603
603
new ABC for access to, opening, and reading *resources * inside packages.
604
604
Resources are roughly similar to files inside packages, but they needn't
605
605
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
607
607
a :class: `importlib.abc.ResourceReader ` instance to support this
608
608
new API. Built-in file path loaders and zip file loaders both support this.
609
609
@@ -910,9 +910,9 @@ which allows listing the names of properties which should not become
910
910
enum members.
911
911
(Contributed by Ethan Furman in :issue: `31801 `.)
912
912
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 `
914
914
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
916
916
raise :exc: `TypeError ` (e.g. ``1 in Perm.RW ``); currently, both operations
917
917
return :const: `False ` instead and are deprecated.
918
918
(Contributed by Ethan Furman in :issue: `33217 `.)
@@ -969,7 +969,7 @@ uses the current working directory.
969
969
(Contributed by Stéphane Wirtel and Julien Palard in :issue: `28707 `.)
970
970
971
971
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 `.
973
973
It is used when ``http.server `` is run with ``-m ``.
974
974
(Contributed by Julien Palard in :issue: `31639 `.)
975
975
@@ -1052,12 +1052,12 @@ support the loading of resources from packages. See also
1052
1052
lacks a spec.
1053
1053
(Contributed by Garvit Khatri in :issue: `29851 `.)
1054
1054
1055
- :func: `importlib.find_spec ` now raises :exc: `ModuleNotFoundError ` instead of
1055
+ :func: `importlib.util. find_spec ` now raises :exc: `ModuleNotFoundError ` instead of
1056
1056
:exc: `AttributeError ` if the specified parent module is not a package (i.e.
1057
1057
lacks a ``__path__ `` attribute).
1058
1058
(Contributed by Milan Oberkirch in :issue: `30436 `.)
1059
1059
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
1061
1061
the passed source. A :ref: `hash-based .pyc file <whatsnew37-pep552 >`
1062
1062
embeds the value returned by this function.
1063
1063
@@ -1148,7 +1148,7 @@ running.
1148
1148
(Contributed by Antoine Pitrou in :issue: `30596 `.)
1149
1149
1150
1150
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.
1152
1152
(Contributed by Vitor Pereira in :issue: `30794 `.)
1153
1153
1154
1154
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
1280
1280
compatibility across platforms.
1281
1281
(Contributed by Christian Heimes in :issue: `32454 `.)
1282
1282
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.
1286
1287
(Contributed by Omar Sandoval in :issue: `26273 ` and
1287
1288
Nathaniel J. Smith in :issue: `29728 `.)
1288
1289
@@ -1298,11 +1299,14 @@ by default.
1298
1299
socketserver
1299
1300
------------
1300
1301
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
1303
1306
until all child processes complete.
1304
1307
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
1306
1310
:class: `socketserver.ForkingMixIn ` and :class: `socketserver.ThreadingMixIn `
1307
1311
classes. Set the class attribute to ``False `` to get the pre-3.7 behaviour.
1308
1312
@@ -1323,7 +1327,7 @@ ssl
1323
1327
---
1324
1328
1325
1329
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
1327
1331
are validated during TLS handshake. Any certificate validation error
1328
1332
including failing the host name check now raises
1329
1333
:exc: `~ssl.SSLCertVerificationError ` and aborts the handshake with a proper
@@ -1341,7 +1345,7 @@ Host name validation can be customized with
1341
1345
The ``ssl `` module no longer sends IP addresses in SNI TLS extension.
1342
1346
(Contributed by Christian Heimes in :issue: `32185 `.)
1343
1347
1344
- :func: `~ssl. match_hostname ` no longer supports partial wildcards like
1348
+ :func: `! match_hostname ` no longer supports partial wildcards like
1345
1349
``www*.example.org ``.
1346
1350
(Contributed by Mandeep Singh in :issue: `23033 ` and Christian Heimes in
1347
1351
:issue: `31399 `.)
@@ -1438,7 +1442,7 @@ The new :func:`sys.get_coroutine_origin_tracking_depth` function returns
1438
1442
the current coroutine origin tracking depth, as set by
1439
1443
the new :func: `sys.set_coroutine_origin_tracking_depth `. :mod: `asyncio `
1440
1444
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 `.
1442
1446
(Contributed by Nathaniel J. Smith in :issue: `32591 `.)
1443
1447
1444
1448
@@ -1615,7 +1619,7 @@ external entities by default.
1615
1619
xml.etree
1616
1620
---------
1617
1621
1618
- :ref: `ElementPath <elementtree-xpath >` predicates in the :meth: `find `
1622
+ :ref: `ElementPath <elementtree-xpath >` predicates in the :meth: `! find `
1619
1623
methods can now compare text of the current node with ``[. = "text"] ``,
1620
1624
not only text in children. Predicates also allow adding spaces for
1621
1625
better readability. (Contributed by Stefan Behnel in :issue: `31648 `.)
@@ -1624,7 +1628,7 @@ better readability. (Contributed by Stefan Behnel in :issue:`31648`.)
1624
1628
xmlrpc.server
1625
1629
-------------
1626
1630
1627
- :meth: `SimpleXMLRPCDispatcher.register_function <xmlrpc.server.SimpleXMLRPCDispatcher> `
1631
+ :meth: `! SimpleXMLRPCDispatcher.register_function `
1628
1632
can now be used as a decorator. (Contributed by Xiang Zhang in
1629
1633
:issue: `7769 `.)
1630
1634
@@ -1682,15 +1686,15 @@ The :mod:`tracemalloc` now exposes a C API through the new
1682
1686
functions.
1683
1687
(Contributed by Victor Stinner in :issue: `30054 `.)
1684
1688
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.
1688
1692
(Contributed by Christian Heimes in :issue: `31574 `.)
1689
1693
1690
1694
The fields :c:member: `!name ` and :c:member: `!doc ` of structures
1691
1695
:c:type: `PyMemberDef `, :c:type: `PyGetSetDef `,
1692
1696
: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
1694
1698
``char * ``. (Contributed by Serhiy Storchaka in :issue: `28761 `.)
1695
1699
1696
1700
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
1719
1723
and access to the UTC singleton with :c:data: `PyDateTime_TimeZone_UTC `.
1720
1724
Contributed by Paul Ganssle in :issue: `10381 `.
1721
1725
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
1724
1728
:c:func: `PyThreadState_SetAsyncExc ` changed from :c:expr: `long ` to
1725
1729
:c:expr: `unsigned long `.
1726
1730
(Contributed by Serhiy Storchaka in :issue: `6532 `.)
@@ -1847,8 +1851,8 @@ make the creation of named tuples 4 to 6 times faster.
1847
1851
(Contributed by Jelle Zijlstra with further improvements by INADA Naoki,
1848
1852
Serhiy Storchaka, and Raymond Hettinger in :issue: `28638 `.)
1849
1853
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.
1852
1856
(Contributed by Paul Ganssle in :issue: `32403 `.)
1853
1857
1854
1858
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).
1997
2001
enum
1998
2002
----
1999
2003
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 `
2001
2005
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
2003
2007
raise :exc: `TypeError ` (e.g. ``1 in Perm.RW ``); currently, both operations
2004
2008
return :const: `False ` instead.
2005
2009
(Contributed by Ethan Furman in :issue: `33217 `.)
@@ -2034,14 +2038,14 @@ favour of :class:`importlib.abc.ResourceReader`.
2034
2038
locale
2035
2039
------
2036
2040
2037
- :func: `locale.format ` has been deprecated, use :meth: `locale.format_string `
2041
+ :func: `! locale.format ` has been deprecated, use :meth: `locale.format_string `
2038
2042
instead. (Contributed by Garvit in :issue: `10379 `.)
2039
2043
2040
2044
2041
2045
macpath
2042
2046
-------
2043
2047
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.
2045
2049
(Contributed by Chi Hsuan Yen in :issue: `9850 `.)
2046
2050
2047
2051
@@ -2066,7 +2070,7 @@ if the passed argument is larger than 16 bits, an exception will be raised.
2066
2070
ssl
2067
2071
---
2068
2072
2069
- :func: `ssl.wrap_socket ` is deprecated. Use
2073
+ :func: `! ssl.wrap_socket ` is deprecated. Use
2070
2074
:meth: `ssl.SSLContext.wrap_socket ` instead.
2071
2075
(Contributed by Christian Heimes in :issue: `28124 `.)
2072
2076
@@ -2082,8 +2086,8 @@ Use :func:`!sunau.open` instead.
2082
2086
sys
2083
2087
---
2084
2088
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 `.
2087
2091
2088
2092
The undocumented ``sys.callstats() `` function has been deprecated and
2089
2093
will be removed in a future Python version.
@@ -2093,7 +2097,7 @@ will be removed in a future Python version.
2093
2097
wave
2094
2098
----
2095
2099
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.
2097
2101
Use :func: `wave.open ` instead.
2098
2102
(Contributed by Brian Curtin in :issue: `31985 `.)
2099
2103
@@ -2173,8 +2177,8 @@ The following features and APIs have been removed from Python 3.7:
2173
2177
2174
2178
* Removed previously deprecated in Python 2.4 classes ``Plist ``, ``Dict `` and
2175
2179
``_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
2178
2182
can use attribute access to access items of these dictionaries.
2179
2183
2180
2184
* The ``asyncio.windows_utils.socketpair() `` function has been
@@ -2191,7 +2195,7 @@ The following features and APIs have been removed from Python 3.7:
2191
2195
* Direct instantiation of :class: `ssl.SSLSocket ` and :class: `ssl.SSLObject `
2192
2196
objects is now prohibited. The constructors were never documented, tested,
2193
2197
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 `.
2195
2199
(Contributed by Christian Heimes in :issue: `32951 `.)
2196
2200
2197
2201
* The unused ``distutils `` ``install_misc `` command has been removed.
@@ -2275,15 +2279,18 @@ Changes in Python Behavior
2275
2279
Changes in the Python API
2276
2280
-------------------------
2277
2281
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
2279
2284
non-daemon threads complete. Set the new
2280
2285
:attr: `socketserver.ThreadingMixIn.block_on_close ` class attribute to
2281
2286
``False `` to get the pre-3.7 behaviour.
2282
2287
(Contributed by Victor Stinner in :issue: `31233 ` and :issue: `33540 `.)
2283
2288
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
2285
2291
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 ``
2287
2294
to get the pre-3.7 behaviour.
2288
2295
(Contributed by Victor Stinner in :issue: `31151 ` and :issue: `33540 `.)
2289
2296
0 commit comments