[issue25147] Enum: remove dependency on OrderedDict

Serhiy Storchaka report at bugs.python.org
Thu Sep 17 19:44:00 CEST 2015


Serhiy Storchaka added the comment:

_collections exists because it contains C implementations of some collections classes or helpers. _collections itself is imported only in collections and threading. And in threading the same idiom as proposed by Eric is used:

try:
    from _collections import deque as _deque
except ImportError:
    from collections import deque as _deque

What is the cost of importing OrderedDict at all? Ethan, can you provide any measurement results?

----------
nosy: +rhettinger

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


More information about the Python-bugs-list mailing list