bpo-43838: Use a copy to delegate types.MappingProxyType operators - #27300
brandtbucher wants to merge 5 commits into
Conversation
type.MappingProxyType operatorstypes.MappingProxyType operators
|
Closing and reopening to trigger CI. |
|
Note @ncoghlan's comment on the issue:
|
|
@brandtbucher pointed out on the ticket that my alternative proposal was based on a flawed assumption: that the dict method implementations would play well with others even without the coercion dance. They don't, they rely on the coercion dance and the fact that every other mapping type plays well with builtin dicts. So it's either make a copy of the underlying object and expose that instead, or reimplement generic union and comparison operations that work for any mapping type. |
|
This PR is stale because it has been open for 30 days with no activity. |
This keeps us from breaking encapsulation and (in 3.11) possibly segfaulting.
Should this be backported to 3.9 as a bugfix? If so, the docs should be updated to read
.. versionchanged:: 3.9.7.https://bugs.python.org/issue43838