@@ -536,7 +536,7 @@ Other Language Changes
536
536
element is a callable with a ``(obj, state) `` signature. This allows the
537
537
direct control over the state-updating behavior of a specific object. If
538
538
not *None *, this callable will have priority over the object's
539
- :meth: `~__setstate__ ` method.
539
+ :meth: `~object. __setstate__ ` method.
540
540
(Contributed by Pierre Glaser and Olivier Grisel in :issue: `35900 `.)
541
541
542
542
New Modules
@@ -1035,9 +1035,9 @@ symlinks and directory junctions) has been delegated to the operating system.
1035
1035
Specifically, :func: `os.stat ` will now traverse anything supported by the
1036
1036
operating system, while :func: `os.lstat ` will only open reparse points that
1037
1037
identify as "name surrogates" while others are opened as for :func: `os.stat `.
1038
- In all cases, :attr: `stat_result.st_mode ` will only have ``S_IFLNK `` set for
1038
+ In all cases, :attr: `os. stat_result.st_mode ` will only have ``S_IFLNK `` set for
1039
1039
symbolic links and not other kinds of reparse points. To identify other kinds
1040
- of reparse point, check the new :attr: `stat_result.st_reparse_tag ` attribute.
1040
+ of reparse point, check the new :attr: `os. stat_result.st_reparse_tag ` attribute.
1041
1041
1042
1042
On Windows, :func: `os.readlink ` is now able to read directory junctions. Note
1043
1043
that :func: `~os.path.islink ` will return ``False `` for directory junctions,
@@ -1285,20 +1285,20 @@ now matches what the C tokenizer does internally.
1285
1285
tkinter
1286
1286
-------
1287
1287
1288
- Added methods :meth: `~tkinter.Spinbox. selection_from `,
1289
- :meth: `~tkinter.Spinbox. selection_present `,
1290
- :meth: `~tkinter.Spinbox. selection_range ` and
1291
- :meth: `~tkinter.Spinbox. selection_to `
1292
- in the :class: `tkinter.Spinbox ` class.
1288
+ Added methods :meth: `! selection_from `,
1289
+ :meth: `! selection_present `,
1290
+ :meth: `! selection_range ` and
1291
+ :meth: `! selection_to `
1292
+ in the :class: `! tkinter.Spinbox ` class.
1293
1293
(Contributed by Juliette Monsel in :issue: `34829 `.)
1294
1294
1295
- Added method :meth: `~tkinter.Canvas. moveto `
1296
- in the :class: `tkinter.Canvas ` class.
1295
+ Added method :meth: `! moveto `
1296
+ in the :class: `! tkinter.Canvas ` class.
1297
1297
(Contributed by Juliette Monsel in :issue: `23831 `.)
1298
1298
1299
- The :class: `tkinter.PhotoImage ` class now has
1300
- :meth: `~tkinter.PhotoImage. transparency_get ` and
1301
- :meth: `~tkinter.PhotoImage. transparency_set ` methods. (Contributed by
1299
+ The :class: `! tkinter.PhotoImage ` class now has
1300
+ :meth: `! transparency_get ` and
1301
+ :meth: `! transparency_set ` methods. (Contributed by
1302
1302
Zackery Spytz in :issue: `25451 `.)
1303
1303
1304
1304
@@ -1432,7 +1432,7 @@ and ``{namespace}*`` which returns all tags in the given namespace.
1432
1432
(Contributed by Stefan Behnel in :issue: `28238 `.)
1433
1433
1434
1434
The :mod: `xml.etree.ElementTree ` module provides a new function
1435
- :func: `– xml.etree.ElementTree.canonicalize ` that implements C14N 2.0.
1435
+ :func: `~ xml.etree.ElementTree.canonicalize ` that implements C14N 2.0.
1436
1436
(Contributed by Stefan Behnel in :issue: `13611 `.)
1437
1437
1438
1438
The target object of :class: `xml.etree.ElementTree.XMLParser ` can
@@ -1573,7 +1573,7 @@ Build and C API Changes
1573
1573
1574
1574
* :c:func: `Py_INCREF `, :c:func: `Py_DECREF `
1575
1575
* :c:func: `Py_XINCREF `, :c:func: `Py_XDECREF `
1576
- * :c:func: ` PyObject_INIT `, :c:func: ` PyObject_INIT_VAR `
1576
+ * :c:macro: ` ! PyObject_INIT `, :c:macro: ` ! PyObject_INIT_VAR `
1577
1577
* Private functions: :c:func: `!_PyObject_GC_TRACK `,
1578
1578
:c:func: `!_PyObject_GC_UNTRACK `, :c:func: `!_Py_Dealloc `
1579
1579
@@ -1677,7 +1677,7 @@ Deprecated
1677
1677
constant nodes.
1678
1678
(Contributed by Serhiy Storchaka in :issue: `36917 `.)
1679
1679
1680
- * The :func: ` asyncio.coroutine ` :term: `decorator ` is deprecated and will be
1680
+ * The :deco: ` ! asyncio.coroutine ` :term: `decorator ` is deprecated and will be
1681
1681
removed in version 3.10. Instead of ``@asyncio.coroutine ``, use
1682
1682
:keyword: `async def ` instead.
1683
1683
(Contributed by Andrew Svetlov in :issue: `36921 `.)
@@ -1697,22 +1697,22 @@ Deprecated
1697
1697
(Contributed by Yury Selivanov in :issue: `34790 `.)
1698
1698
1699
1699
* The following functions and methods are deprecated in the :mod: `gettext `
1700
- module: :func: `~gettext. lgettext `, :func: `~gettext. ldgettext `,
1701
- :func: `~gettext. lngettext ` and :func: `~gettext. ldngettext `.
1700
+ module: :func: `! lgettext `, :func: `! ldgettext `,
1701
+ :func: `! lngettext ` and :func: `! ldngettext `.
1702
1702
They return encoded bytes, and it's possible that you will get unexpected
1703
1703
Unicode-related exceptions if there are encoding problems with the
1704
1704
translated strings. It's much better to use alternatives which return
1705
1705
Unicode strings in Python 3. These functions have been broken for a long time.
1706
1706
1707
- Function :func: `~gettext. bind_textdomain_codeset `, methods
1708
- :meth: `~gettext. NullTranslations.output_charset ` and
1709
- :meth: `~gettext. NullTranslations.set_output_charset `, and the *codeset *
1707
+ Function :func: `! bind_textdomain_codeset `, methods
1708
+ :meth: `! NullTranslations.output_charset ` and
1709
+ :meth: `! NullTranslations.set_output_charset `, and the *codeset *
1710
1710
parameter of functions :func: `~gettext.translation ` and
1711
1711
:func: `~gettext.install ` are also deprecated, since they are only used for
1712
1712
the ``l*gettext() `` functions.
1713
1713
(Contributed by Serhiy Storchaka in :issue: `33710 `.)
1714
1714
1715
- * The :meth: `~threading.Thread. isAlive ` method of :class: `threading.Thread `
1715
+ * The :meth: `! isAlive ` method of :class: `threading.Thread `
1716
1716
has been deprecated.
1717
1717
(Contributed by Donghee Na in :issue: `35283 `.)
1718
1718
@@ -1727,19 +1727,19 @@ Deprecated
1727
1727
* Deprecated passing the following arguments as keyword arguments:
1728
1728
1729
1729
- *func * in :func: `functools.partialmethod `, :func: `weakref.finalize `,
1730
- :meth: `profile.Profile.runcall `, :meth: `cProfile.Profile.runcall `,
1730
+ :meth: `profile.Profile.runcall `, :meth: `! cProfile.Profile.runcall `,
1731
1731
:meth: `bdb.Bdb.runcall `, :meth: `trace.Trace.runfunc ` and
1732
1732
:func: `curses.wrapper `.
1733
1733
- *function * in :meth: `unittest.TestCase.addCleanup `.
1734
1734
- *fn * in the :meth: `~concurrent.futures.Executor.submit ` method of
1735
1735
:class: `concurrent.futures.ThreadPoolExecutor ` and
1736
1736
:class: `concurrent.futures.ProcessPoolExecutor `.
1737
1737
- *callback * in :meth: `contextlib.ExitStack.callback `,
1738
- :meth: `contextlib.AsyncExitStack.callback ` and
1738
+ :meth: `! contextlib.AsyncExitStack.callback ` and
1739
1739
:meth: `contextlib.AsyncExitStack.push_async_callback `.
1740
- - *c * and *typeid * in the :meth: `~multiprocessing.managers.Server. create `
1741
- method of :class: `multiprocessing.managers.Server ` and
1742
- :class: `multiprocessing.managers.SharedMemoryServer `.
1740
+ - *c * and *typeid * in the :meth: `! create `
1741
+ method of :class: `! multiprocessing.managers.Server ` and
1742
+ :class: `! multiprocessing.managers.SharedMemoryServer `.
1743
1743
- *obj * in :func: `weakref.finalize `.
1744
1744
1745
1745
In future releases of Python, they will be :ref: `positional-only
@@ -1757,14 +1757,14 @@ The following features and APIs have been removed from Python 3.8:
1757
1757
able to import from collections was marked for removal in 3.8, but has been
1758
1758
delayed to 3.9. (See :gh: `81134 `.)
1759
1759
1760
- * The :mod: `macpath ` module, deprecated in Python 3.7, has been removed.
1760
+ * The :mod: `! macpath ` module, deprecated in Python 3.7, has been removed.
1761
1761
(Contributed by Victor Stinner in :issue: `35471 `.)
1762
1762
1763
- * The function :func: `platform.popen ` has been removed, after having been
1763
+ * The function :func: `! platform.popen ` has been removed, after having been
1764
1764
deprecated since Python 3.3: use :func: `os.popen ` instead.
1765
1765
(Contributed by Victor Stinner in :issue: `35345 `.)
1766
1766
1767
- * The function :func: `time.clock ` has been removed, after having been
1767
+ * The function :func: `! time.clock ` has been removed, after having been
1768
1768
deprecated since Python 3.3: use :func: `time.perf_counter ` or
1769
1769
:func: `time.process_time ` instead, depending
1770
1770
on your requirements, to have well-defined behavior.
@@ -1800,8 +1800,8 @@ The following features and APIs have been removed from Python 3.8:
1800
1800
:func: `fileinput.FileInput ` which was ignored and deprecated since Python 3.6
1801
1801
has been removed. :issue: `36952 ` (Contributed by Matthias Bussonnier.)
1802
1802
1803
- * The functions :func: `sys.set_coroutine_wrapper ` and
1804
- :func: `sys.get_coroutine_wrapper ` deprecated in Python 3.7 have been removed;
1803
+ * The functions :func: `! sys.set_coroutine_wrapper ` and
1804
+ :func: `! sys.get_coroutine_wrapper ` deprecated in Python 3.7 have been removed;
1805
1805
:issue: `36933 ` (Contributed by Matthias Bussonnier.)
1806
1806
1807
1807
@@ -1864,9 +1864,10 @@ Changes in the Python API
1864
1864
1865
1865
* :class: `subprocess.Popen ` can now use :func: `os.posix_spawn ` in some cases
1866
1866
for better performance. On Windows Subsystem for Linux and QEMU User
1867
- Emulation, the :class: `Popen ` constructor using :func: `os.posix_spawn ` no longer raises an
1868
- exception on errors like "missing program". Instead the child process fails with a
1869
- non-zero :attr: `~Popen.returncode `.
1867
+ Emulation, the :class: `~subprocess.Popen ` constructor using
1868
+ :func: `os.posix_spawn ` no longer raises an exception on errors like
1869
+ "missing program". Instead the child process fails with a
1870
+ non-zero :attr: `~subprocess.Popen.returncode `.
1870
1871
(Contributed by Joannah Nanjekye and Victor Stinner in :issue: `35537 `.)
1871
1872
1872
1873
* The *preexec_fn * argument of * :class: `subprocess.Popen ` is no longer
@@ -1875,11 +1876,11 @@ Changes in the Python API
1875
1876
(Contributed by Eric Snow in :issue: `34651 `, modified by Christian Heimes
1876
1877
in :issue: `37951 `.)
1877
1878
1878
- * The :meth: `imap .IMAP4.logout ` method no longer silently ignores arbitrary
1879
+ * The :meth: `imaplib .IMAP4.logout ` method no longer silently ignores arbitrary
1879
1880
exceptions.
1880
1881
(Contributed by Victor Stinner in :issue: `36348 `.)
1881
1882
1882
- * The function :func: `platform.popen ` has been removed, after having been deprecated since
1883
+ * The function :func: `! platform.popen ` has been removed, after having been deprecated since
1883
1884
Python 3.3: use :func: `os.popen ` instead.
1884
1885
(Contributed by Victor Stinner in :issue: `35345 `.)
1885
1886
@@ -1894,9 +1895,11 @@ Changes in the Python API
1894
1895
specialized methods like :meth: `~tkinter.ttk.Treeview.selection_set ` for
1895
1896
changing the selection. (Contributed by Serhiy Storchaka in :issue: `31508 `.)
1896
1897
1897
- * The :meth: `writexml `, :meth: `toxml ` and :meth: `toprettyxml ` methods of
1898
- :mod: `xml.dom.minidom `, and the :meth: `write ` method of :mod: `xml.etree `,
1899
- now preserve the attribute order specified by the user.
1898
+ * The :meth: `~xml.dom.minidom.Node.writexml `, :meth: `~xml.dom.minidom.Node.toxml `
1899
+ and :meth: `~xml.dom.minidom.Node.toprettyxml ` methods of
1900
+ :mod: `xml.dom.minidom ` and the :meth: `~xml.etree.ElementTree.ElementTree.write `
1901
+ method of :mod: `xml.etree.ElementTree ` now preserve the attribute order
1902
+ specified by the user.
1900
1903
(Contributed by Diego Rojas and Raymond Hettinger in :issue: `34160 `.)
1901
1904
1902
1905
* A :mod: `dbm.dumb ` database opened with flags ``'r' `` is now read-only.
@@ -1916,8 +1919,8 @@ Changes in the Python API
1916
1919
``type.__new__ ``. A :exc: `DeprecationWarning ` was emitted in Python
1917
1920
3.6--3.7. (Contributed by Serhiy Storchaka in :issue: `23722 `.)
1918
1921
1919
- * The :class: `cProfile.Profile ` class can now be used as a context
1920
- manager. (Contributed by Scott Sanderson in :issue: `29235 `.)
1922
+ * The :class: `cProfile.Profile <profile.Profile> ` class can now be used as
1923
+ a context manager. (Contributed by Scott Sanderson in :issue: `29235 `.)
1921
1924
1922
1925
* :func: `shutil.copyfile `, :func: `shutil.copy `, :func: `shutil.copy2 `,
1923
1926
:func: `shutil.copytree ` and :func: `shutil.move ` use platform-specific
@@ -1952,7 +1955,7 @@ Changes in the Python API
1952
1955
(Contributed by Christian Heimes in :issue: `17239 `.)
1953
1956
1954
1957
* Deleting a key from a read-only :mod: `dbm ` database (:mod: `dbm.dumb `,
1955
- :mod: `dbm.gnu ` or :mod: `dbm.ndbm `) raises :attr: `error ` (:exc: `dbm.dumb.error `,
1958
+ :mod: `dbm.gnu ` or :mod: `dbm.ndbm `) raises :attr: `! error ` (:exc: `dbm.dumb.error `,
1956
1959
:exc: `dbm.gnu.error ` or :exc: `dbm.ndbm.error `) instead of :exc: `KeyError `.
1957
1960
(Contributed by Xiang Zhang in :issue: `33106 `.)
1958
1961
@@ -2044,7 +2047,7 @@ Changes in the C API
2044
2047
:c:func: `PyType_FromSpec `) hold a reference to their type object.
2045
2048
Increasing the reference count of these type objects has been moved from
2046
2049
:c:func: `PyType_GenericAlloc ` to the more low-level functions,
2047
- :c:func: `PyObject_Init ` and :c:func: ` PyObject_INIT `.
2050
+ :c:func: `PyObject_Init ` and :c:macro: ` ! PyObject_INIT `.
2048
2051
This makes types created through :c:func: `PyType_FromSpec ` behave like
2049
2052
other classes in managed code.
2050
2053
@@ -2064,7 +2067,7 @@ Changes in the C API
2064
2067
This may happen after calling :c:macro: `PyObject_New `,
2065
2068
:c:macro: `PyObject_NewVar `, :c:func: `PyObject_GC_New `,
2066
2069
:c:func: `PyObject_GC_NewVar `, or any other custom allocator that uses
2067
- :c:func: `PyObject_Init ` or :c:func: ` PyObject_INIT `.
2070
+ :c:func: `PyObject_Init ` or :c:macro: ` ! PyObject_INIT `.
2068
2071
2069
2072
Example:
2070
2073
0 commit comments