In order not to answer your question:
Bonus question: is there a way to use it in Python2.x?
from ConfigParser import _Chainmap as ChainMap
However, keep in mind that this is not a real ChainMap , it inherits from DictMixin and only defines:
__init__(self, *maps) __getitem__(self, key) keys(self) # And from DictMixin: __iter__(self) has_key(self, key) __contains__(self, key) iteritems(self) iterkeys(self) itervalues(self) values(self) items(self) clear(self) setdefault(self, key, default=None) pop(self, key, *args) popitem(self) update(self, other=None, **kwargs) get(self, key, default=None) __repr__(self) __cmp__(self, other) __len__(self)
Its implementation also does not seem particularly effective.
AT Dec 17 '16 at 13:44 2016-12-17 13:44
source share