[issue43838] There is a way to access an underlying mapping in MappingProxyType

Serhiy Storchaka report at bugs.python.org
Fri Jul 23 03:13:58 EDT 2021


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

For __or__ we need to copy the content of both mapping to the resulting mapping in any case. We can implement it as {**self, **other}. We should not use the copy() method because it is not a part of the Mapping interface.

For __eq__, no copying is needed if we just re-implement Mapping.__eq__ (with special cases for few known types for performance).

----------

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


More information about the Python-bugs-list mailing list