ebw added the comment:
I actually have a real life use case of that problem. Using the eval() function
of pandas need to use a custom resolver:
class Resolver(object):
def __getitem__(self, name):
if name == "test":
return 0.5
else:
raise KeyError
R. David Murray added the comment:
IMO, it would actually be surprising for ChainMap to support unhashable keys.
In Python, as Raymond indicates, "mapping" is pretty much synonymous with
'dict-like', and it would be where that was *not* true that we might add extra
documentation.
--
Raymond Hettinger added the comment:
No thank you. It is perfectly reasonable to use set operations to make the
implementation simple, fast, reliable, and suitable for most use cases.
Marking this as a rejected feature request.
As for documentation, I don't see any need to accommodate a peda
New submission from Serhiy Storchaka:
As documented ChainMap supports not just dicts, but mappings. A mapping can be
implemented not only as a hash table, and mapping keys can be not hashable. But
ChainMap.__len__ and ChainMap.__iter__ work only with hashable keys.
This may be considered just