[issue30144] Import collections ABC from collections.abc rather than collections

Serhiy Storchaka report at bugs.python.org
Sun Apr 23 08:30:13 EDT 2017


New submission from Serhiy Storchaka:

Now abstract collection classes are defined in collections.abc rather than collections. collections contains just aliases for compatibility. Importing collections ABC from collections.abc is more idiomatic. And when aliases will be removed from collection this will be the only way.

But some code still imports them from collections. Proposed patch makes it importing them from collections.abc.

The most basic modules like locale, weakref and pathlib could import them just from _collections_abc for decreasing the startup time, but this is different issue.

The patch doesn't touch the collections module itself and its tests, and the _decimal module which imports collections.MutableMapping in C code (changing this would require more rewriting).

----------
components: Library (Lib)
messages: 292164
nosy: rhettinger, serhiy.storchaka, stutzbach
priority: normal
severity: normal
stage: patch review
status: open
title: Import collections ABC from collections.abc rather than collections
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30144>
_______________________________________


More information about the Python-bugs-list mailing list