[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-10 Thread Steve Canny
Steve Canny added the comment: The resolution for me (the python-pptx and python-docx libraries) is clear, to add a separate `import collections.abc` statement rather than assuming (hoping) that the `collections.abc` module is available on an `abc` attribute of the `collections` module. I

[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also, the collections module could simply delete abc if it already exists due to collections.abc being imported first. -- ___ Python tracker

[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: > On Mac, collections.abc is imported at startup time > via site.py (which imports rlcompleter, which imports > inspect, which imports collections.abc). In inspect.py, the import of collections.abc is only used inside isawaitable(). We could make that a

[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-10 Thread Mark Dickinson
Mark Dickinson added the comment: On Mac, collections.abc is imported at startup time via site.py (which imports rlcompleter, which imports inspect, which imports collections.abc). I'd guess it's the same on Linux. mdickinson@mirzakhani cpython % ./python.exe Python 3.11.0a2+

[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: > this coincides with collection ABCs being made unavailable directly from > `collections` with this 3.9 -> 3.10 version change Direct access from collections was removed after being deprecated for almost almost a decade ago: "Using or importing

[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-10 Thread Steve Dower
Steve Dower added the comment: Since collections.abc is a module, it should work if you import it: >>> import collections.abc >>> collections.abc.Container Submodules being implicitly imported is not part of any API guarantee, which will be why somebody changed it without considering this

[issue45776] abc submodule not an attribute of collections on Python 3.10.0 on Windows

2021-11-09 Thread Steve Canny
New submission from Steve Canny : On CPython 3.10.0 on Windows but not MacOS, AttributeError is raised when referencing `abc` on collections (instead of importing `collections.abc`). >>> import collections >>> collections.abc.Container AttributeError: module 'collections' has no attribute