[issue32792] ChainMap should preserve order of underlying mappings

Serhiy Storchaka report at bugs.python.org
Thu Feb 8 04:24:41 EST 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

An alternate implementation:

d = {}
for mapping in reversed(self.maps):
    d.update(mapping)
return iter(d)

Unfortunately both implementations work only with hashable keys. In general case mappings may be not hashtables.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32792>
_______________________________________


More information about the Python-bugs-list mailing list