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.

Author serhiy.storchaka
Recipients barry, eli.bendersky, eric.snow, ethan.furman, r.david.murray, rhettinger, serhiy.storchaka, vstinner
Date 2015-09-17.17:43:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442511840.06.0.732841037464.issue25147@psf.upfronthosting.co.za>
In-reply-to
Content
_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?
History
Date User Action Args
2015-09-17 17:44:00serhiy.storchakasetrecipients: + serhiy.storchaka, barry, rhettinger, vstinner, r.david.murray, eli.bendersky, ethan.furman, eric.snow
2015-09-17 17:44:00serhiy.storchakasetmessageid: <1442511840.06.0.732841037464.issue25147@psf.upfronthosting.co.za>
2015-09-17 17:43:59serhiy.storchakalinkissue25147 messages
2015-09-17 17:43:59serhiy.storchakacreate