This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: AttributeError: module 'collections' has no attribute 'Mapping'
Type: behavior Stage: resolved
Components: Versions: Python 3.10
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: AlexWaygood, mareklachbc, steven.daprano
Priority: normal Keywords:

Created on 2022-01-12 13:21 by mareklachbc, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg410395 - (view) Author: Alex Waygood (AlexWaygood) * (Python triager) Date: 2022-01-12 13:38
Hi -- thanks for the report! You haven't given us many details here, but I think this is intentional behaviour, not a bug -- this was changed in Issue37324. Importing `Mapping` (along with many other names) directly from `collections`, instead of from `collections.abc`, has been deprecated since Python 3.3, and was removed in Python 3.10. So instead of writing `from collections import Mapping`, simply write `from collections.abc import Mapping`, and you should find that no error is raised.
msg410399 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2022-01-12 14:15
Hi mareklachbc,

What makes you think that this is a bug? 

Since at least version 3.7, you will have seen this warning:


    >>> import collections
    >>> collections.Mapping
    __main__:1: DeprecationWarning: Using or importing the ABCs from
    'collections' instead of from 'collections.abc' is deprecated
    since Python 3.3,and in 3.9 it will stop working


So this is not a bug.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90512
2022-01-12 14:15:23steven.dapranosetstatus: pending -> closed

nosy: + steven.daprano
messages: + msg410399

stage: resolved
2022-01-12 13:38:07AlexWaygoodsetstatus: open -> pending

nosy: + AlexWaygood
messages: + msg410395

resolution: not a bug
2022-01-12 13:21:28mareklachbccreate