On Sun, 3 Apr 2022, 12:58 pm Steven D'Aprano, <st...@pearwood.info> wrote:
> > I haven't considered pickling, or deep-copying. I don't think there is > any way to get access to the underlying dict and modify it, except > perhaps via ctypes, so I think it is as immutable as it is possible to > get from Python code. Feel free to take that as a challenge to break it. > MappingProxyType does expose the underlying mapping to the other operand during type coercion for binary operators (and trying to prevent that causes enough problems that we decided the problem wasn't worth fixing): https://bugs.python.org/issue43838 For a lot of use cases, MappingProxyType is already a "good enough" immutable dict, but it does have a definite discoverability problem. Cheers, Nick. > >
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/3DN5BIOAZSG7YFVVHVRVF66MJC5YNJON/ Code of Conduct: http://python.org/psf/codeofconduct/