You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
522 B

  1. # -*- coding: utf-8 -*-
  2. """Code for defining types depending on fast implementations
  3. Namely, defines the type ``OrderedDict``:
  4. - on CPython >=3.6, define as ``dict``
  5. - otherwise, if ``cyordereddict`` is available use
  6. ``cyordereddict.OrderedDict``
  7. - otherwise, use ``collections.OrderedDict``
  8. """
  9. import sys
  10. if sys.version_info[:2] >= (3, 6):
  11. OrderedDict = dict
  12. else:
  13. try:
  14. from cyordereddict import OrderedDict
  15. except ImportError:
  16. from collections import OrderedDict # noqa: ignore=F401