Dennis Sweeney <[email protected]> added the comment:
PR 20749 gives each dict view access to a mappingproxy for the original dict,
although I don't know if that defeats the original purpose.
It might be hard to sensibly make MappingProxy(d).items() return something
other than d.items(), since this is already the behavior for user-defined
classes:
>>> class A:
def __getitem__(self, key):
return "value"
def items(self):
return 17
>>> from types import MappingProxyType
>>> MappingProxyType(A()).items()
17
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40890>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com