@@ -181,7 +181,7 @@ Coroutine functions are declared using the new :keyword:`async def` syntax::
181
181
Inside a coroutine function, the new :keyword: `await ` expression can be used
182
182
to suspend coroutine execution until the result is available. Any object
183
183
can be *awaited *, as long as it implements the :term: `awaitable ` protocol by
184
- defining the :meth: `__await__ ` method.
184
+ defining the :meth: `~object. __await__ ` method.
185
185
186
186
PEP 492 also adds :keyword: `async for ` statement for convenient iteration
187
187
over asynchronous iterables.
@@ -273,9 +273,10 @@ PEP 465 - A dedicated infix operator for matrix multiplication
273
273
274
274
:pep: `465 ` adds the ``@ `` infix operator for matrix multiplication.
275
275
Currently, no builtin Python types implement the new operator, however, it
276
- can be implemented by defining :meth: `__matmul__ `, :meth: `__rmatmul__ `,
277
- and :meth: `__imatmul__ ` for regular, reflected, and in-place matrix
278
- multiplication. The semantics of these methods is similar to that of
276
+ can be implemented by defining :meth: `~object.__matmul__ `,
277
+ :meth: `~object.__rmatmul__ `, and :meth: `~object.__imatmul__ ` for regular,
278
+ reflected, and in-place matrix multiplication.
279
+ The semantics of these methods is similar to that of
279
280
methods defining other infix arithmetic operators.
280
281
281
282
Matrix multiplication is a notably common operation in many fields of
@@ -800,7 +801,7 @@ Notable changes in the :mod:`asyncio` module since Python 3.4.0:
800
801
control.
801
802
(Contributed by Victor Stinner.)
802
803
803
- * The :func: `~asyncio. async ` function is deprecated in favor of
804
+ * The :func: `! async ` function is deprecated in favor of
804
805
:func: `~asyncio.ensure_future `.
805
806
(Contributed by Yury Selivanov.)
806
807
@@ -905,10 +906,8 @@ collections
905
906
The :class: `~collections.OrderedDict ` class is now implemented in C, which
906
907
makes it 4 to 100 times faster. (Contributed by Eric Snow in :issue: `16991 `.)
907
908
908
- :meth: `OrderedDict.items() <collections.OrderedDict.items> `,
909
- :meth: `OrderedDict.keys() <collections.OrderedDict.keys> `,
910
- :meth: `OrderedDict.values() <collections.OrderedDict.values> ` views now support
911
- :func: `reversed ` iteration.
909
+ :meth: `!OrderedDict.items `, :meth: `!OrderedDict.keys `,
910
+ and :meth: `!OrderedDict.values ` views now support :func: `reversed ` iteration.
912
911
(Contributed by Serhiy Storchaka in :issue: `19505 `.)
913
912
914
913
The :class: `~collections.deque ` class now defines
@@ -928,7 +927,7 @@ Docstrings produced by :func:`~collections.namedtuple` can now be updated::
928
927
(Contributed by Berker Peksag in :issue: `24064 `.)
929
928
930
929
The :class: `~collections.UserString ` class now implements the
931
- :meth: `__getnewargs__ `, :meth: `__rmod__ `, :meth: `~str.casefold `,
930
+ :meth: `~object. __getnewargs__ `, :meth: `~object. __rmod__ `, :meth: `~str.casefold `,
932
931
:meth: `~str.format_map `, :meth: `~str.isprintable `, and :meth: `~str.maketrans `
933
932
methods to match the corresponding methods of :class: `str `.
934
933
(Contributed by Joe Jevnik in :issue: `22189 `.)
@@ -937,7 +936,7 @@ methods to match the corresponding methods of :class:`str`.
937
936
collections.abc
938
937
---------------
939
938
940
- The :meth: `Sequence.index() <collections.abc.Sequence .index> ` method now
939
+ The :meth: `Sequence.index() <collections.abc.MutableSequence .index> ` method now
941
940
accepts *start * and *stop * arguments to match the corresponding methods
942
941
of :class: `tuple `, :class: `list `, etc.
943
942
(Contributed by Devin Jeanpierre in :issue: `23086 `.)
@@ -1045,8 +1044,8 @@ not just sequences. (Contributed by Serhiy Storchaka in :issue:`23171`.)
1045
1044
curses
1046
1045
------
1047
1046
1048
- The new :func: `~curses.update_lines_cols ` function updates the :data: `LINES `
1049
- and :data: `COLS ` module variables. This is useful for detecting
1047
+ The new :func: `~curses.update_lines_cols ` function updates the :data: `~curses. LINES `
1048
+ and :data: `~curses. COLS ` module variables. This is useful for detecting
1050
1049
manual screen resizing. (Contributed by Arnon Yaari in :issue: `4254 `.)
1051
1050
1052
1051
@@ -1347,8 +1346,8 @@ network objects from existing addresses::
1347
1346
1348
1347
(Contributed by Peter Moody and Antoine Pitrou in :issue: `16531 `.)
1349
1348
1350
- A new :attr: `~ipaddress.IPv4Network .reverse_pointer ` attribute for the
1351
- :class: `~ipaddress.IPv4Network ` and :class: `~ipaddress.IPv6Network ` classes
1349
+ A new :attr: `~ipaddress.IPv4Address .reverse_pointer ` attribute for the
1350
+ :class: `~ipaddress.IPv4Address ` and :class: `~ipaddress.IPv6Address ` classes
1352
1351
returns the name of the reverse DNS PTR record::
1353
1352
1354
1353
>>> import ipaddress
@@ -1451,7 +1450,7 @@ and :data:`~math.nan`. (Contributed by Mark Dickinson in :issue:`23185`.)
1451
1450
A new function :func: `~math.isclose ` provides a way to test for approximate
1452
1451
equality. (Contributed by Chris Barker and Tal Einat in :issue: `24270 `.)
1453
1452
1454
- A new :func: `~math.gcd ` function has been added. The :func: `fractions.gcd `
1453
+ A new :func: `~math.gcd ` function has been added. The :func: `! fractions.gcd `
1455
1454
function is now deprecated. (Contributed by Mark Dickinson and Serhiy
1456
1455
Storchaka in :issue: `22486 `.)
1457
1456
@@ -1602,10 +1601,10 @@ The :func:`~re.sub` and :func:`~re.subn` functions now replace unmatched
1602
1601
groups with empty strings instead of raising an exception.
1603
1602
(Contributed by Serhiy Storchaka in :issue: `1519638 `.)
1604
1603
1605
- The :class: `re.error ` exceptions have new attributes,
1606
- :attr: `~re.error .msg `, :attr: `~re.error .pattern `,
1607
- :attr: `~re.error .pos `, :attr: `~re.error .lineno `,
1608
- and :attr: `~re.error .colno `, that provide better context
1604
+ The :class: `re.error <re.PatternError> ` exceptions have new attributes,
1605
+ :attr: `~re.PatternError .msg `, :attr: `~re.PatternError .pattern `,
1606
+ :attr: `~re.PatternError .pos `, :attr: `~re.PatternError .lineno `,
1607
+ and :attr: `~re.PatternError .colno `, that provide better context
1609
1608
information about the error::
1610
1609
1611
1610
>>> re.compile("""
@@ -1794,10 +1793,10 @@ query the actual protocol version in use.
1794
1793
(Contributed by Antoine Pitrou in :issue: `20421 `.)
1795
1794
1796
1795
The :class: `~ssl.SSLSocket ` class now implements
1797
- a :meth: `SSLSocket.sendfile() <ssl.SSLSocket.sendfile> ` method.
1796
+ a :meth: `! SSLSocket.sendfile ` method.
1798
1797
(Contributed by Giampaolo Rodola' in :issue: `17552 `.)
1799
1798
1800
- The :meth: `SSLSocket.send() <ssl.SSLSocket.send> ` method now raises either
1799
+ The :meth: `! SSLSocket.send ` method now raises either
1801
1800
the :exc: `ssl.SSLWantReadError ` or :exc: `ssl.SSLWantWriteError ` exception on a
1802
1801
non-blocking socket if the operation would block. Previously, it would return
1803
1802
``0 ``. (Contributed by Nikolaus Rath in :issue: `20951 `.)
@@ -1806,20 +1805,20 @@ The :func:`~ssl.cert_time_to_seconds` function now interprets the input time
1806
1805
as UTC and not as local time, per :rfc: `5280 `. Additionally, the return
1807
1806
value is always an :class: `int `. (Contributed by Akira Li in :issue: `19940 `.)
1808
1807
1809
- New :meth: `SSLObject.shared_ciphers() <ssl.SSLObject.shared_ciphers> ` and
1808
+ New :meth: `! SSLObject.shared_ciphers ` and
1810
1809
:meth: `SSLSocket.shared_ciphers() <ssl.SSLSocket.shared_ciphers> ` methods return
1811
1810
the list of ciphers sent by the client during the handshake.
1812
1811
(Contributed by Benjamin Peterson in :issue: `23186 `.)
1813
1812
1814
1813
The :meth: `SSLSocket.do_handshake() <ssl.SSLSocket.do_handshake> `,
1815
1814
:meth: `SSLSocket.read() <ssl.SSLSocket.read> `,
1816
- :meth: `SSLSocket.shutdown() <ssl.SSLSocket.shutdown> `, and
1815
+ :meth: `! SSLSocket.shutdown `, and
1817
1816
:meth: `SSLSocket.write() <ssl.SSLSocket.write> ` methods of the :class: `~ssl.SSLSocket `
1818
1817
class no longer reset the socket timeout every time bytes are received or sent.
1819
1818
The socket timeout is now the maximum total duration of the method.
1820
1819
(Contributed by Victor Stinner in :issue: `23853 `.)
1821
1820
1822
- The :func: `~ssl. match_hostname ` function now supports matching of IP addresses.
1821
+ The :func: `! match_hostname ` function now supports matching of IP addresses.
1823
1822
(Contributed by Antoine Pitrou in :issue: `23239 `.)
1824
1823
1825
1824
@@ -1863,10 +1862,10 @@ Examples::
1863
1862
sys
1864
1863
---
1865
1864
1866
- A new :func: `~sys. set_coroutine_wrapper ` function allows setting a global
1865
+ A new :func: `! set_coroutine_wrapper ` function allows setting a global
1867
1866
hook that will be called whenever a :term: `coroutine object <coroutine> `
1868
1867
is created by an :keyword: `async def ` function. A corresponding
1869
- :func: `~sys. get_coroutine_wrapper ` can be used to obtain a currently set
1868
+ :func: `! get_coroutine_wrapper ` can be used to obtain a currently set
1870
1869
wrapper. Both functions are :term: `provisional <provisional API> `,
1871
1870
and are intended for debugging purposes only. (Contributed by Yury Selivanov
1872
1871
in :issue: `24017 `.)
@@ -2014,8 +2013,9 @@ The :class:`~unittest.mock.Mock` class has the following improvements:
2014
2013
method to check if the mock object was called.
2015
2014
(Contributed by Kushal Das in :issue: `21262 `.)
2016
2015
2017
- The :class: `~unittest.mock.MagicMock ` class now supports :meth: `__truediv__ `,
2018
- :meth: `__divmod__ ` and :meth: `__matmul__ ` operators.
2016
+ The :class: `~unittest.mock.MagicMock ` class now supports
2017
+ :meth: `~object.__truediv__ `, :meth: `~object.__divmod__ `
2018
+ and :meth: `~object.__matmul__ ` operators.
2019
2019
(Contributed by Johannes Baiter in :issue: `20968 `, and Håkan Lövdahl
2020
2020
in :issue: `23581 ` and :issue: `23568 `.)
2021
2021
@@ -2290,10 +2290,10 @@ Windows XP is no longer supported by Microsoft, thus, per :PEP:`11`, CPython
2290
2290
Deprecated Python modules, functions and methods
2291
2291
------------------------------------------------
2292
2292
2293
- The :mod: `formatter ` module has now graduated to full deprecation and is still
2293
+ The :mod: `! formatter ` module has now graduated to full deprecation and is still
2294
2294
slated for removal in Python 3.6.
2295
2295
2296
- The :func: `asyncio.async ` function is deprecated in favor of
2296
+ The :func: `! asyncio.async ` function is deprecated in favor of
2297
2297
:func: `~asyncio.ensure_future `.
2298
2298
2299
2299
The :mod: `!smtpd ` module has in the past always decoded the DATA portion of
@@ -2314,7 +2314,7 @@ Passing a format string as keyword argument *format_string* to the
2314
2314
class has been deprecated.
2315
2315
(Contributed by Serhiy Storchaka in :issue: `23671 `.)
2316
2316
2317
- The :func: `platform.dist ` and :func: `platform.linux_distribution ` functions
2317
+ The :func: `! platform.dist ` and :func: `! platform.linux_distribution ` functions
2318
2318
are now deprecated. Linux distributions use too many different ways of
2319
2319
describing themselves, so the functionality is left to a package.
2320
2320
(Contributed by Vajrasky Kok and Berker Peksag in :issue: `1322 `.)
@@ -2328,7 +2328,7 @@ The :func:`inspect.getargspec` function is deprecated and scheduled to be
2328
2328
removed in Python 3.6. (See :issue: `20438 ` for details.)
2329
2329
2330
2330
The :mod: `inspect ` :func: `~inspect.getfullargspec `,
2331
- :func: `~inspect.getcallargs `, and :func: `~inspect. formatargspec ` functions are
2331
+ :func: `~inspect.getcallargs `, and :func: `! formatargspec ` functions are
2332
2332
deprecated in favor of the :func: `inspect.signature ` API. (Contributed by Yury
2333
2333
Selivanov in :issue: `20438 `.)
2334
2334
@@ -2405,7 +2405,7 @@ Changes in the Python API
2405
2405
error-prone and has been removed in Python 3.5. See :issue: `13936 ` for full
2406
2406
details.
2407
2407
2408
- * The :meth: `ssl.SSLSocket.send ` method now raises either
2408
+ * The :meth: `! ssl.SSLSocket.send ` method now raises either
2409
2409
:exc: `ssl.SSLWantReadError ` or :exc: `ssl.SSLWantWriteError `
2410
2410
on a non-blocking socket if the operation would block. Previously,
2411
2411
it would return ``0 ``. (Contributed by Nikolaus Rath in :issue: `20951 `.)
@@ -2440,12 +2440,12 @@ Changes in the Python API
2440
2440
:mod: `http.client ` and :mod: `http.server ` remain available for backwards
2441
2441
compatibility. (Contributed by Demian Brecht in :issue: `21793 `.)
2442
2442
2443
- * When an import loader defines :meth: `importlib.machinery .Loader.exec_module `
2443
+ * When an import loader defines :meth: `~ importlib.abc .Loader.exec_module `
2444
2444
it is now expected to also define
2445
- :meth: `~importlib.machinery .Loader.create_module ` (raises a
2445
+ :meth: `~importlib.abc .Loader.create_module ` (raises a
2446
2446
:exc: `DeprecationWarning ` now, will be an error in Python 3.6). If the loader
2447
2447
inherits from :class: `importlib.abc.Loader ` then there is nothing to do, else
2448
- simply define :meth: `~importlib.machinery .Loader.create_module ` to return
2448
+ simply define :meth: `~importlib.abc .Loader.create_module ` to return
2449
2449
``None ``. (Contributed by Brett Cannon in :issue: `23014 `.)
2450
2450
2451
2451
* The :func: `re.split ` function always ignored empty pattern matches, so the
@@ -2488,7 +2488,7 @@ Changes in the Python API
2488
2488
the POT-Creation-Date header.
2489
2489
2490
2490
* The :mod: `smtplib ` module now uses :data: `sys.stderr ` instead of the previous
2491
- module-level :data: `stderr ` variable for debug output. If your (test)
2491
+ module-level :data: `! stderr ` variable for debug output. If your (test)
2492
2492
program depends on patching the module-level variable to capture the debug
2493
2493
output, you will need to update it to capture sys.stderr instead.
2494
2494
@@ -2514,11 +2514,11 @@ Changes in the C API
2514
2514
--------------------
2515
2515
2516
2516
* The undocumented :c:member: `!format ` member of the
2517
- (non-public) :c:type: `PyMemoryViewObject ` structure has been removed.
2517
+ (non-public) :c:type: `! PyMemoryViewObject ` structure has been removed.
2518
2518
All extensions relying on the relevant parts in ``memoryobject.h ``
2519
2519
must be rebuilt.
2520
2520
2521
- * The :c:type: `PyMemAllocator ` structure was renamed to
2521
+ * The :c:type: `! PyMemAllocator ` structure was renamed to
2522
2522
:c:type: `PyMemAllocatorEx ` and a new ``calloc `` field was added.
2523
2523
2524
2524
* Removed non-documented macro :c:macro: `!PyObject_REPR() ` which leaked references.
0 commit comments