# new class in collections
try:
from collections import ChainMap as compat_collections_chain_map
+ # Py3.3's ChainMap is deficient
+ if sys.version_info <= (3, 3):
+ raise ImportError
except ImportError:
- # Py < 3.3
+ # Py <= 3.3
class compat_collections_chain_map(compat_collections_abc.MutableMapping):
maps = [{}]
def parents(self):
return compat_collections_chain_map(*(self.maps[1:]))
+
# Pythons disagree on the type of a pattern (RegexObject, _sre.SRE_Pattern, Pattern, ...?)
compat_re_Pattern = type(re.compile(''))