Skip to content

Commit eea47e0

Browse files
Matthias Bussonniermiss-islington
Matthias Bussonnier
authored andcommitted
bpo-36953: Delay removal of ABCs from collections. (GH-13409)
Bump the removal to 3.9, indicate collections.abc available since 3.3, replace version-changed directive to deprecated-removed. https://bugs.python.org/issue36953
1 parent 5437ccc commit eea47e0

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Doc/library/collections.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Python's general purpose built-in containers, :class:`dict`, :class:`list`,
3333
:class:`UserString` wrapper around string objects for easier string subclassing
3434
===================== ====================================================================
3535

36-
.. versionchanged:: 3.3
36+
.. deprecated-removed:: 3.3 3.9
3737
Moved :ref:`collections-abstract-base-classes` to the :mod:`collections.abc` module.
3838
For backwards compatibility, they continue to be visible in this module through
39-
Python 3.7. Subsequently, they will be removed entirely.
39+
Python 3.8.
4040

4141

4242
:class:`ChainMap` objects

Lib/collections/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def __getattr__(name):
4747
obj = getattr(_collections_abc, name)
4848
import warnings
4949
warnings.warn("Using or importing the ABCs from 'collections' instead "
50-
"of from 'collections.abc' is deprecated, "
51-
"and in 3.8 it will stop working",
50+
"of from 'collections.abc' is deprecated since Python 3.3,"
51+
"and in 3.9 it will stop working",
5252
DeprecationWarning, stacklevel=2)
5353
globals()[name] = obj
5454
return obj
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Starting with Python 3.3, importing ABCs from :mod:`collections` is
2+
deprecated, and import should be done from :mod:`collections.abc`. Still
3+
being able to import from :mod:`collections` was marked for removal in 3.8,
4+
but has been delayed to 3.9; documentation and ``DeprecationWarning``
5+
clarified.

0 commit comments

Comments
 (0)