Raymond Hettinger <[email protected]> added the comment:
[Serhiy]
> In particularly it allows to modify __dict__ of builtin types.
This doesn't look like something that would happen accidentally. We've never
had any bug reports about this occurring in the wild.
[GvR]
> Maybe we should not fix this then?
That seems reasonable. In general, it is hard to completely wall-off instances
against deliberate efforts to pry them open:
>>> from types import MappingProxyType
>>> import gc
>>> orig = {1: 2}
>>> proxy = MappingProxyType(orig)
>>> refs = gc.get_referents(proxy)
>>> refs
[{1: 2}]
>>> refs[0][1] = 3
>>> orig
{1: 3}
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43838>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com