@@ -1587,78 +1587,107 @@ This section lists Python APIs that have been deprecated in Python 3.11.
1587
1587
1588
1588
Deprecated C APIs are :ref: `listed separately <whatsnew311-c-api-deprecated >`.
1589
1589
1590
+
1591
+ .. _whatsnew311-deprecated-language :
1592
+ .. _whatsnew311-deprecated-builtins :
1593
+
1594
+ Language/Builtins
1595
+ -----------------
1596
+
1590
1597
* Chaining :class: `classmethod ` descriptors (introduced in :issue: `19072 `)
1591
1598
is now deprecated. It can no longer be used to wrap other descriptors
1592
1599
such as :class: `property `. The core design of this feature was flawed
1593
1600
and caused a number of downstream problems. To "pass-through" a
1594
- :class: `classmethod `, consider using the `` __wrapped__ ` ` attribute
1601
+ :class: `classmethod `, consider using the :attr: ` ! __wrapped__ ` attribute
1595
1602
that was added in Python 3.10.
1596
1603
(Contributed by Raymond Hettinger in :gh: `89519 `.)
1597
1604
1598
- * Octal escapes in string and bytes literals with value larger than ``0o377 `` now
1599
- produce :exc: `DeprecationWarning `.
1600
- In a future Python version they will be a :exc: `SyntaxWarning ` and
1605
+ * Octal escapes in string and bytes literals with values larger than ``0o377 ``
1606
+ (255 in decimal) now produce a :exc: `DeprecationWarning `.
1607
+ In a future Python version, they will raise a :exc: `SyntaxWarning ` and
1601
1608
eventually a :exc: `SyntaxError `.
1602
1609
(Contributed by Serhiy Storchaka in :gh: `81548 `.)
1603
1610
1604
- * The :mod: `lib2to3 ` package and ``2to3 `` tool are now deprecated and may not
1605
- be able to parse Python 3.10 or newer. See the :pep: `617 ` (New PEG parser for
1606
- CPython). (Contributed by Victor Stinner in :issue: `40360 `.)
1611
+ * The delegation of :func: `int ` to :meth: `~object.__trunc__ ` is now deprecated.
1612
+ Calling ``int(a) `` when ``type(a) `` implements :meth: `!__trunc__ ` but not
1613
+ :meth: `~object.__int__ ` or :meth: `~object.__index__ ` now raises
1614
+ a :exc: `DeprecationWarning `.
1615
+ (Contributed by Zackery Spytz in :issue: `44977 `.)
1607
1616
1608
- * Undocumented modules ``sre_compile ``, ``sre_constants `` and ``sre_parse ``
1609
- are now deprecated.
1610
- (Contributed by Serhiy Storchaka in :issue: `47152 `.)
1611
1617
1612
- * :class: `webbrowser.MacOSX ` is deprecated and will be removed in Python 3.13.
1613
- It is untested and undocumented and also not used by webbrowser itself.
1614
- (Contributed by Dong-hee Na in :issue: `42255 `.)
1618
+ .. _whatsnew311-deprecated-modules :
1615
1619
1616
- * The behavior of returning a value from a :class: `~unittest.TestCase ` and
1617
- :class: `~unittest.IsolatedAsyncioTestCase ` test methods (other than the
1618
- default ``None `` value), is now deprecated.
1620
+ Modules
1621
+ -------
1619
1622
1620
- * Deprecated the following :mod: `unittest ` functions, scheduled for removal in
1621
- Python 3.13:
1623
+ .. _whatsnew311-pep594 :
1622
1624
1623
- * :func: `unittest.findTestCases `
1624
- * :func: `unittest.makeSuite `
1625
- * :func: `unittest.getTestCaseNames `
1625
+ * :pep: `594 ` led to the deprecations of the following modules
1626
+ slated for removal in Python 3.13:
1626
1627
1627
- Use :class: `~unittest.TestLoader ` method instead:
1628
+ +---------------------+---------------------+---------------------+---------------------+---------------------+
1629
+ | :mod: `aifc ` | :mod: `chunk ` | :mod: `msilib ` | :mod: `pipes ` | :mod: `telnetlib ` |
1630
+ +---------------------+---------------------+---------------------+---------------------+---------------------+
1631
+ | :mod: `audioop ` | :mod: `crypt ` | :mod: `nis ` | :mod: `sndhdr ` | :mod: `uu ` |
1632
+ +---------------------+---------------------+---------------------+---------------------+---------------------+
1633
+ | :mod: `cgi ` | :mod: `imghdr ` | :mod: `nntplib ` | :mod: `spwd ` | :mod: `xdrlib ` |
1634
+ +---------------------+---------------------+---------------------+---------------------+---------------------+
1635
+ | :mod: `cgitb ` | :mod: `mailcap ` | :mod: `ossaudiodev ` | :mod: `sunau ` | |
1636
+ +---------------------+---------------------+---------------------+---------------------+---------------------+
1628
1637
1629
- * :meth: `unittest.TestLoader.loadTestsFromModule `
1630
- * :meth: `unittest.TestLoader.loadTestsFromTestCase `
1631
- * :meth: `unittest.TestLoader.getTestCaseNames `
1638
+ (Contributed by Brett Cannon in :issue: `47061 ` and Victor Stinner in
1639
+ :gh: `68966 `.)
1632
1640
1633
- (Contributed by Erlend E. Aasland in :issue: `5846 `.)
1641
+ * The :mod: `asynchat `, :mod: `asyncore ` and :mod: `smtpd ` modules have been
1642
+ deprecated since at least Python 3.6. Their documentation and deprecation
1643
+ warnings have now been updated to note they will removed in Python 3.12.
1644
+ (Contributed by Hugo van Kemenade in :issue: `47022 `.)
1634
1645
1635
- * The :meth: `turtle.RawTurtle.settiltangle ` is deprecated since Python 3.1,
1636
- it now emits a deprecation warning and will be removed in Python 3.13. Use
1637
- :meth: `turtle.RawTurtle.tiltangle ` instead (it was earlier incorrectly marked
1638
- as deprecated, its docstring is now corrected).
1639
- (Contributed by Hugo van Kemenade in :issue: `45837 `.)
1646
+ * The :mod: `lib2to3 ` package and :ref: `2to3 <2to3-reference >` tool
1647
+ are now deprecated and may not be able to parse Python 3.10 or newer.
1648
+ See :pep: `617 `, introducing the new PEG parser, for details.
1649
+ (Contributed by Victor Stinner in :issue: `40360 `.)
1650
+
1651
+ * Undocumented modules :mod: `!sre_compile `, :mod: `!sre_constants `
1652
+ and :mod: `!sre_parse ` are now deprecated.
1653
+ (Contributed by Serhiy Storchaka in :issue: `47152 `.)
1640
1654
1641
- * The delegation of :func: `int ` to :meth: `__trunc__ ` is now deprecated. Calling
1642
- ``int(a) `` when ``type(a) `` implements :meth: `__trunc__ ` but not
1643
- :meth: `__int__ ` or :meth: `__index__ ` now raises a :exc: `DeprecationWarning `.
1644
- (Contributed by Zackery Spytz in :issue: `44977 `.)
1655
+
1656
+ .. _whatsnew311-deprecated-stdlib :
1657
+
1658
+ Standard Library
1659
+ ----------------
1645
1660
1646
1661
* The following have been deprecated in :mod: `configparser ` since Python 3.2.
1647
1662
Their deprecation warnings have now been updated to note they will removed in
1648
1663
Python 3.12:
1649
1664
1650
- * the :class: `configparser.SafeConfigParser ` class
1651
- * the :attr: `configparser.ParsingError.filename ` property
1665
+ * the :class: `! configparser.SafeConfigParser ` class
1666
+ * the :attr: `! configparser.ParsingError.filename ` property
1652
1667
* the :meth: `configparser.RawConfigParser.readfp ` method
1653
1668
1654
1669
(Contributed by Hugo van Kemenade in :issue: `45173 `.)
1655
1670
1656
- * :class: `configparser.LegacyInterpolation ` has been deprecated in the docstring
1657
- since Python 3.2. It now emits a :exc: `DeprecationWarning ` and will be removed
1671
+ * :class: `!configparser.LegacyInterpolation ` has been deprecated in the docstring
1672
+ since Python 3.2, and is not listed in the :mod: `configparser ` documentation.
1673
+ It now emits a :exc: `DeprecationWarning ` and will be removed
1658
1674
in Python 3.13. Use :class: `configparser.BasicInterpolation ` or
1659
1675
:class: `configparser.ExtendedInterpolation ` instead.
1660
1676
(Contributed by Hugo van Kemenade in :issue: `46607 `.)
1661
1677
1678
+ * The older set of :mod: `importlib.resources ` functions were deprecated
1679
+ in favor of the replacements added in Python 3.9
1680
+ and will be removed in a future Python version,
1681
+ due to not supporting resources located within package subdirectories:
1682
+
1683
+ * :func: `importlib.resources.contents `
1684
+ * :func: `importlib.resources.is_resource `
1685
+ * :func: `importlib.resources.open_binary `
1686
+ * :func: `importlib.resources.open_text `
1687
+ * :func: `importlib.resources.read_binary `
1688
+ * :func: `importlib.resources.read_text `
1689
+ * :func: `importlib.resources.path `
1690
+
1662
1691
* The :func: `locale.getdefaultlocale ` function is deprecated and will be
1663
1692
removed in Python 3.13. Use :func: `locale.setlocale `,
1664
1693
:func: `locale.getpreferredencoding(False) <locale.getpreferredencoding> ` and
@@ -1669,61 +1698,58 @@ Deprecated C APIs are :ref:`listed separately <whatsnew311-c-api-deprecated>`.
1669
1698
removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "") `` instead.
1670
1699
(Contributed by Victor Stinner in :gh: `90817 `.)
1671
1700
1672
- .. _whatsnew311-pep594 :
1673
-
1674
- * :pep: `594 ` led to the deprecations of the following modules which are
1675
- slated for removal in Python 3.13:
1676
-
1677
- * :mod: `aifc `
1678
- * :mod: `audioop `
1679
- * :mod: `cgi `
1680
- * :mod: `cgitb `
1681
- * :mod: `chunk `
1682
- * :mod: `crypt `
1683
- * :mod: `imghdr `
1684
- * :mod: `mailcap `
1685
- * :mod: `msilib `
1686
- * :mod: `nis `
1687
- * :mod: `nntplib `
1688
- * :mod: `ossaudiodev `
1689
- * :mod: `pipes `
1690
- * :mod: `sndhdr `
1691
- * :mod: `spwd `
1692
- * :mod: `sunau `
1693
- * :mod: `telnetlib `
1694
- * :mod: `uu `
1695
- * :mod: `xdrlib `
1696
-
1697
- (Contributed by Brett Cannon in :issue: `47061 ` and Victor Stinner in
1698
- :gh: `68966 `.)
1701
+ * Stricter rules will now be applied for numerical group references
1702
+ and group names in :ref: `regular expressions <re-syntax >`.
1703
+ Only sequences of ASCII digits will now be accepted as a numerical reference,
1704
+ and the group name in :class: `bytes ` patterns and replacement strings
1705
+ can only contain ASCII letters, digits and underscores.
1706
+ For now, a deprecation warning is raised for syntax violating these rules.
1707
+ (Contributed by Serhiy Storchaka in :gh: `91760 `.)
1699
1708
1700
- * The :mod: `asynchat `, :mod: `asyncore ` and :mod: `smtpd ` modules have been
1701
- deprecated since at least Python 3.6. Their documentation and deprecation
1702
- warnings have now been updated to note they will removed in Python 3.12.
1703
- (Contributed by Hugo van Kemenade in :issue: `47022 `.)
1709
+ * In the :mod: `re ` module, the :func: `!re.template ` function
1710
+ and the corresponding :data: `!re.TEMPLATE ` and :data: `!re.T ` flags
1711
+ are deprecated, as they were undocumented and lacked an obvious purpose.
1712
+ They will be removed in Python 3.13.
1713
+ (Contributed by Serhiy Storchaka and Miro Hrončok in :gh: `92728 `.)
1704
1714
1705
- * More strict rules will be applied now applied for numerical group references
1706
- and group names in regular expressions in future Python versions.
1707
- Only sequence of ASCII digits will be now accepted as a numerical reference.
1708
- The group name in bytes patterns and replacement strings could only
1709
- contain ASCII letters and digits and underscore.
1710
- For now, a deprecation warning is raised for such syntax.
1711
- (Contributed by Serhiy Storchaka in :gh: `91760 `.)
1715
+ * :func: `turtle.settiltangle ` has been deprecated since Python 3.1;
1716
+ it now emits a deprecation warning and will be removed in Python 3.13. Use
1717
+ :func: `turtle.tiltangle ` instead (it was earlier incorrectly marked
1718
+ as deprecated, and its docstring is now corrected).
1719
+ (Contributed by Hugo van Kemenade in :issue: `45837 `.)
1712
1720
1713
1721
* :class: `typing.Text `, which exists solely to provide compatibility support
1714
1722
between Python 2 and Python 3 code, is now deprecated. Its removal is
1715
1723
currently unplanned, but users are encouraged to use :class: `str ` instead
1716
1724
wherever possible.
1717
1725
(Contributed by Alex Waygood in :gh: `92332 `.)
1718
1726
1719
- * The keyword argument syntax for constructing :data: `~ typing.TypedDict ` types
1727
+ * The keyword argument syntax for constructing :data: `typing.TypedDict ` types
1720
1728
is now deprecated. Support will be removed in Python 3.13. (Contributed by
1721
1729
Jingchen Ye in :gh: `90224 `.)
1722
1730
1723
- * The :func: `re.template ` function and the corresponding :const: `re.TEMPLATE `
1724
- and :const: `re.T ` flags are deprecated, as they were undocumented and
1725
- lacked an obvious purpose. They will be removed in Python 3.13.
1726
- (Contributed by Serhiy Storchaka and Miro Hrončok in :gh: `92728 `.)
1731
+ * :class: `!webbrowser.MacOSX ` is deprecated and will be removed in Python 3.13.
1732
+ It is untested, undocumented, and not used by :mod: `webbrowser ` itself.
1733
+ (Contributed by Dong-hee Na in :issue: `42255 `.)
1734
+
1735
+ * The behavior of returning a value from a :class: `~unittest.TestCase ` and
1736
+ :class: `~unittest.IsolatedAsyncioTestCase ` test methods (other than the
1737
+ default ``None `` value) is now deprecated.
1738
+
1739
+ * Deprecated the following not-formally-documented :mod: `unittest ` functions,
1740
+ scheduled for removal in Python 3.13:
1741
+
1742
+ * :func: `!unittest.findTestCases `
1743
+ * :func: `!unittest.makeSuite `
1744
+ * :func: `!unittest.getTestCaseNames `
1745
+
1746
+ Use :class: `~unittest.TestLoader ` methods instead:
1747
+
1748
+ * :meth: `unittest.TestLoader.loadTestsFromModule `
1749
+ * :meth: `unittest.TestLoader.loadTestsFromTestCase `
1750
+ * :meth: `unittest.TestLoader.getTestCaseNames `
1751
+
1752
+ (Contributed by Erlend E. Aasland in :issue: `5846 `.)
1727
1753
1728
1754
1729
1755
.. _whatsnew311-pending-removal :
0 commit comments