@@ -745,7 +745,7 @@ Some smaller changes made to the core Python language are:
745
745
746
746
* It is now possible to set a :ref: `special method <specialnames >` to
747
747
``None `` to indicate that the corresponding operation is not available.
748
- For example, if a class sets :meth: `__iter__ ` to ``None ``, the class
748
+ For example, if a class sets :meth: `~object. __iter__ ` to ``None ``, the class
749
749
is not iterable.
750
750
(Contributed by Andrew Barnert and Ivan Levkivskyi in :issue: `25958 `.)
751
751
@@ -871,7 +871,7 @@ Notable changes in the :mod:`asyncio` module since Python 3.5.0
871
871
of the last iteration will be discarded.
872
872
(Contributed by Guido van Rossum in :issue: `25593 `.)
873
873
874
- * :meth: `Future.set_exception <asyncio.futures. Future.set_exception> `
874
+ * :meth: `Future.set_exception <asyncio.Future.set_exception> `
875
875
will now raise :exc: `TypeError ` when passed an instance of
876
876
the :exc: `StopIteration ` exception.
877
877
(Contributed by Chris Angelico in :issue: `26221 `.)
@@ -925,7 +925,7 @@ added to represent sized iterable container classes.
925
925
(Contributed by Ivan Levkivskyi, docs by Neil Girdhar in :issue: `27598 `.)
926
926
927
927
The new :class: `~collections.abc.Reversible ` abstract base class represents
928
- iterable classes that also provide the :meth: `__reversed__ ` method.
928
+ iterable classes that also provide the :meth: `~object. __reversed__ ` method.
929
929
(Contributed by Ivan Levkivskyi in :issue: `25987 `.)
930
930
931
931
The new :class: `~collections.abc.AsyncGenerator ` abstract base class represents
@@ -971,7 +971,7 @@ datetime
971
971
--------
972
972
973
973
The :class: `~datetime.datetime ` and :class: `~datetime.time ` classes have
974
- the new :attr: `~time.fold ` attribute used to disambiguate local time
974
+ the new :attr: `~datetime. time.fold ` attribute used to disambiguate local time
975
975
when necessary. Many functions in the :mod: `datetime ` have been
976
976
updated to support local time disambiguation.
977
977
See :ref: `Local Time Disambiguation <whatsnew36-pep495 >` section for more
@@ -1052,12 +1052,12 @@ enum
1052
1052
----
1053
1053
1054
1054
Two new enumeration base classes have been added to the :mod: `enum ` module:
1055
- :class: `~enum.Flag ` and :class: `~enum.IntFlags `. Both are used to define
1055
+ :class: `~enum.Flag ` and :class: `~enum.IntFlag `. Both are used to define
1056
1056
constants that can be combined using the bitwise operators.
1057
1057
(Contributed by Ethan Furman in :issue: `23591 `.)
1058
1058
1059
1059
Many standard library modules have been updated to use the
1060
- :class: `~enum.IntFlags ` class for their constants.
1060
+ :class: `~enum.IntFlag ` class for their constants.
1061
1061
1062
1062
The new :class: `enum.auto ` value can be used to assign values to enum
1063
1063
members automatically::
@@ -1275,7 +1275,7 @@ See the summary of :ref:`PEP 519 <whatsnew36-pep519>` for details on how the
1275
1275
1276
1276
A new :meth: `~os.scandir.close ` method allows explicitly closing a
1277
1277
:func: `~os.scandir ` iterator. The :func: `~os.scandir ` iterator now
1278
- supports the :term: `context manager ` protocol. If a :func: `scandir `
1278
+ supports the :term: `context manager ` protocol. If a :func: `! scandir `
1279
1279
iterator is neither exhausted nor explicitly closed a :exc: `ResourceWarning `
1280
1280
will be emitted in its destructor.
1281
1281
(Contributed by Serhiy Storchaka in :issue: `25994 `.)
@@ -1434,7 +1434,7 @@ defined in :mod:`http.server`, :mod:`xmlrpc.server` and
1434
1434
protocol.
1435
1435
(Contributed by Aviv Palivoda in :issue: `26404 `.)
1436
1436
1437
- The :attr: `~ socketserver.StreamRequestHandler .wfile ` attribute of
1437
+ The :attr: `wfile < socketserver.DatagramRequestHandler .wfile> ` attribute of
1438
1438
:class: `~socketserver.StreamRequestHandler ` classes now implements
1439
1439
the :class: `io.BufferedIOBase ` writable interface. In particular,
1440
1440
calling :meth: `~io.BufferedIOBase.write ` is now guaranteed to send the
@@ -1465,7 +1465,7 @@ The new :meth:`~ssl.SSLContext.get_ciphers` method can be used to
1465
1465
get a list of enabled ciphers in order of cipher priority.
1466
1466
1467
1467
All constants and flags have been converted to :class: `~enum.IntEnum ` and
1468
- :class: `~enum.IntFlags `.
1468
+ :class: `~enum.IntFlag `.
1469
1469
(Contributed by Christian Heimes in :issue: `28025 `.)
1470
1470
1471
1471
Server and client-side specific TLS protocols for :class: `~ssl.SSLContext `
@@ -1531,8 +1531,8 @@ Stéphane Wirtel in :issue:`25485`).
1531
1531
time
1532
1532
----
1533
1533
1534
- The :class: `~time.struct_time ` attributes :attr: `tm_gmtoff ` and
1535
- :attr: `tm_zone ` are now available on all platforms.
1534
+ The :class: `~time.struct_time ` attributes :attr: `! tm_gmtoff ` and
1535
+ :attr: `! tm_zone ` are now available on all platforms.
1536
1536
1537
1537
1538
1538
timeit
@@ -1551,12 +1551,12 @@ between best and worst times.
1551
1551
tkinter
1552
1552
-------
1553
1553
1554
- Added methods :meth: `~tkinter. Variable.trace_add `,
1555
- :meth: `~tkinter. Variable.trace_remove ` and :meth: `~tkinter.Variable. trace_info `
1556
- in the :class: `tkinter.Variable ` class. They replace old methods
1557
- :meth: `~tkinter.Variable. trace_variable `, :meth: `~tkinter.Variable. trace `,
1558
- :meth: `~tkinter.Variable. trace_vdelete ` and
1559
- :meth: `~tkinter.Variable. trace_vinfo ` that use obsolete Tcl commands and might
1554
+ Added methods :meth: `! Variable.trace_add `,
1555
+ :meth: `! Variable.trace_remove ` and :meth: `! trace_info `
1556
+ in the :class: `! tkinter.Variable ` class. They replace old methods
1557
+ :meth: `! trace_variable `, :meth: `! trace `,
1558
+ :meth: `! trace_vdelete ` and
1559
+ :meth: `! trace_vinfo ` that use obsolete Tcl commands and might
1560
1560
not work in future versions of Tcl.
1561
1561
(Contributed by Serhiy Storchaka in :issue: `22115 `).
1562
1562
@@ -1674,8 +1674,8 @@ urllib.request
1674
1674
1675
1675
If a HTTP request has a file or iterable body (other than a
1676
1676
bytes object) but no ``Content-Length `` header, rather than
1677
- throwing an error, :class: `~ urllib.request.AbstractHTTPHandler ` now
1678
- falls back to use chunked transfer encoding.
1677
+ throwing an error, :class: `AbstractHTTPHandler < urllib.request.HTTPHandler> `
1678
+ now falls back to use chunked transfer encoding.
1679
1679
(Contributed by Demian Brecht and Rolf Krahl in :issue: `12319 `.)
1680
1680
1681
1681
@@ -1701,7 +1701,7 @@ warnings
1701
1701
A new optional *source * parameter has been added to the
1702
1702
:func: `warnings.warn_explicit ` function: the destroyed object which emitted a
1703
1703
:exc: `ResourceWarning `. A *source * attribute has also been added to
1704
- :class: `warnings.WarningMessage ` (contributed by Victor Stinner in
1704
+ :class: `! warnings.WarningMessage ` (contributed by Victor Stinner in
1705
1705
:issue: `26568 ` and :issue: `26567 `).
1706
1706
1707
1707
When a :exc: `ResourceWarning ` warning is logged, the :mod: `tracemalloc ` module is now
@@ -1942,7 +1942,7 @@ Raising the :exc:`StopIteration` exception inside a generator will now
1942
1942
generate a :exc: `DeprecationWarning `, and will trigger a :exc: `RuntimeError `
1943
1943
in Python 3.7. See :ref: `whatsnew-pep-479 ` for details.
1944
1944
1945
- The :meth: `__aiter__ ` method is now expected to return an asynchronous
1945
+ The :meth: `~object. __aiter__ ` method is now expected to return an asynchronous
1946
1946
iterator directly instead of returning an awaitable as previously.
1947
1947
Doing the former will trigger a :exc: `DeprecationWarning `. Backward
1948
1948
compatibility will be removed in Python 3.7.
@@ -2189,16 +2189,16 @@ Changes in the Python API
2189
2189
booleans being a subclass of integers, this should only be an issue if you
2190
2190
were doing identity checks for ``1 `` or ``0 ``. See :issue: `25768 `.
2191
2191
2192
- * Reading the :attr: `~urllib.parse.SplitResult. port ` attribute of
2192
+ * Reading the :attr: `! port ` attribute of
2193
2193
:func: `urllib.parse.urlsplit ` and :func: `~urllib.parse.urlparse ` results
2194
2194
now raises :exc: `ValueError ` for out-of-range values, rather than
2195
2195
returning :const: `None `. See :issue: `20059 `.
2196
2196
2197
2197
* The :mod: `!imp ` module now raises a :exc: `DeprecationWarning ` instead of
2198
2198
:exc: `PendingDeprecationWarning `.
2199
2199
2200
- * The following modules have had missing APIs added to their :attr: ` __all__ `
2201
- attributes to match the documented APIs:
2200
+ * The following modules have had missing APIs added to their
2201
+ :attr: ` ~module.__all__ ` attributes to match the documented APIs:
2202
2202
:mod: `calendar `, :mod: `!cgi `, :mod: `csv `,
2203
2203
:mod: `~xml.etree.ElementTree `, :mod: `enum `,
2204
2204
:mod: `fileinput `, :mod: `ftplib `, :mod: `logging `, :mod: `mailbox `,
@@ -2253,11 +2253,13 @@ Changes in the Python API
2253
2253
* As part of :pep: `487 `, the handling of keyword arguments passed to
2254
2254
:class: `type ` (other than the metaclass hint, ``metaclass ``) is now
2255
2255
consistently delegated to :meth: `object.__init_subclass__ `. This means that
2256
- :meth: `type.__new__ ` and :meth: `type.__init__ ` both now accept arbitrary
2257
- keyword arguments, but :meth: `object.__init_subclass__ ` (which is called from
2258
- :meth: `type.__new__ `) will reject them by default. Custom metaclasses
2259
- accepting additional keyword arguments will need to adjust their calls to
2260
- :meth: `type.__new__ ` (whether direct or via :class: `super `) accordingly.
2256
+ :meth: `type.__new__ <object.__new__> ` and :meth: `type.__init__
2257
+ <object.__init__> ` both now accept arbitrary keyword arguments,
2258
+ but :meth: `object.__init_subclass__ ` (which is called from
2259
+ :meth: `type.__new__ <object.__new__> `) will reject them by default.
2260
+ Custom metaclasses accepting additional keyword arguments will need to adjust
2261
+ their calls to :meth: `type.__new__ <object.__new__> `
2262
+ (whether direct or via :class: `super `) accordingly.
2261
2263
2262
2264
* In ``distutils.command.sdist.sdist ``, the ``default_format ``
2263
2265
attribute has been removed and is no longer honored. Instead, the
@@ -2305,7 +2307,7 @@ Changes in the Python API
2305
2307
real-world compatibility.
2306
2308
(Contributed by Lita Cho in :issue: `21815 `.)
2307
2309
2308
- * The :func: `mmap.write() < mmap.write> ` function now returns the number
2310
+ * The :func: `mmap.mmap.write ` function now returns the number
2309
2311
of bytes written like other write methods.
2310
2312
(Contributed by Jakub Stasiak in :issue: `26335 `.)
2311
2313
0 commit comments