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