Skip to content

Commit 6bb4cbe

Browse files
authored
Deprecate for recommended five years
1 parent bfbe4b7 commit 6bb4cbe

File tree

13 files changed

+19
-20
lines changed

13 files changed

+19
-20
lines changed
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
Pending removal in Python 3.17
22
------------------------------
33

4-
* :mod:`collections.abc`:
5-
6-
- :class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. Prefer
7-
:class:`~collections.abc.Sequence` or :class:`~collections.abc.Buffer`. For use in
8-
type annotations, prefer a union, like ``bytes | bytearray``, or
9-
:class:`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)
10-
114
* :mod:`typing`:
125

136
- Before Python 3.14, old-style unions were implemented using the private class
147
``typing._UnionGenericAlias``. This class is no longer needed for the implementation,
158
but it has been retained for backward compatibility, with removal scheduled for Python
169
3.17. Users should use documented introspection helpers like :func:`typing.get_origin`
1710
and :func:`typing.get_args` instead of relying on private implementation details.
18-
1911
- :class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for removal in
2012
Python 3.17. Prefer :class:`~collections.abc.Sequence` or
2113
:class:`~collections.abc.Buffer`. For use in type annotations, prefer a union, like
2214
``bytes | bytearray``, or :class:`collections.abc.Buffer`.
2315
(Contributed by Shantanu Jain in :gh:`91896`.)
16+
17+
* :mod:`collections.abc`:
18+
19+
- :class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. Prefer
20+
:class:`~collections.abc.Sequence` or :class:`~collections.abc.Buffer`. For use in
21+
type annotations, prefer a union, like ``bytes | bytearray``, or
22+
:class:`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)

Lib/test/test_argparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7360,7 +7360,7 @@ class TestModule(unittest.TestCase):
73607360
def test_deprecated__version__(self):
73617361
with self.assertWarnsRegex(
73627362
DeprecationWarning,
7363-
"'__version__' is deprecated and slated for removal in Python 3.17",
7363+
"'__version__' is deprecated and slated for removal in Python 3.20",
73647364
) as cm:
73657365
getattr(argparse, "__version__")
73667366
self.assertEqual(cm.filename, __file__)

Lib/test/test_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ class TestModule(unittest.TestCase):
16081608
def test_deprecated__version__(self):
16091609
with self.assertWarnsRegex(
16101610
DeprecationWarning,
1611-
"'__version__' is deprecated and slated for removal in Python 3.17",
1611+
"'__version__' is deprecated and slated for removal in Python 3.20",
16121612
) as cm:
16131613
getattr(csv, "__version__")
16141614
self.assertEqual(cm.filename, __file__)

Lib/test/test_ctypes/test_macholib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_deprecated__version__(self):
114114

115115
with self.assertWarnsRegex(
116116
DeprecationWarning,
117-
"'__version__' is deprecated and slated for removal in Python 3.17",
117+
"'__version__' is deprecated and slated for removal in Python 3.20",
118118
) as cm:
119119
getattr(ctypes.macholib, "__version__")
120120
self.assertEqual(cm.filename, __file__)

Lib/test/test_ipaddress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2825,7 +2825,7 @@ class TestModule(unittest.TestCase):
28252825
def test_deprecated__version__(self):
28262826
with self.assertWarnsRegex(
28272827
DeprecationWarning,
2828-
"'__version__' is deprecated and slated for removal in Python 3.17",
2828+
"'__version__' is deprecated and slated for removal in Python 3.20",
28292829
) as cm:
28302830
getattr(ipaddress, "__version__")
28312831
self.assertEqual(cm.filename, __file__)

Lib/test/test_json/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TestModule(unittest.TestCase):
5151
def test_deprecated__version__(self):
5252
with self.assertWarnsRegex(
5353
DeprecationWarning,
54-
"'__version__' is deprecated and slated for removal in Python 3.17",
54+
"'__version__' is deprecated and slated for removal in Python 3.20",
5555
) as cm:
5656
getattr(json, "__version__")
5757
self.assertEqual(cm.filename, __file__)

Lib/test/test_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7238,7 +7238,7 @@ def test__all__(self):
72387238

72397239
class TestModule(unittest.TestCase):
72407240
def test_deprecated__version__and__date__(self):
7241-
msg = "is deprecated and slated for removal in Python 3.17"
7241+
msg = "is deprecated and slated for removal in Python 3.20"
72427242
for attr in ("__version__", "__date__"):
72437243
with self.subTest(attr=attr):
72447244
with self.assertWarnsRegex(DeprecationWarning, msg) as cm:

Lib/test/test_optparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ class TestModule(unittest.TestCase):
16701670
def test_deprecated__version__(self):
16711671
with self.assertWarnsRegex(
16721672
DeprecationWarning,
1673-
"'__version__' is deprecated and slated for removal in Python 3.17",
1673+
"'__version__' is deprecated and slated for removal in Python 3.20",
16741674
) as cm:
16751675
getattr(optparse, "__version__")
16761676
self.assertEqual(cm.filename, __file__)

Lib/test/test_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,7 +3120,7 @@ class TestModule(unittest.TestCase):
31203120
def test_deprecated__version__(self):
31213121
with self.assertWarnsRegex(
31223122
DeprecationWarning,
3123-
"'__version__' is deprecated and slated for removal in Python 3.17",
3123+
"'__version__' is deprecated and slated for removal in Python 3.20",
31243124
) as cm:
31253125
getattr(re, "__version__")
31263126
self.assertEqual(cm.filename, __file__)

Lib/test/test_socketserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ class TestModule(unittest.TestCase):
515515
def test_deprecated__version__(self):
516516
with self.assertWarnsRegex(
517517
DeprecationWarning,
518-
"'__version__' is deprecated and slated for removal in Python 3.17",
518+
"'__version__' is deprecated and slated for removal in Python 3.20",
519519
) as cm:
520520
getattr(socketserver, "__version__")
521521
self.assertEqual(cm.filename, __file__)

0 commit comments

Comments
 (0)