Victor Stinner wrote: >>> The blacklist implementation has a major issue: it is still possible >>> to call write methods of the dict class (e.g. dict.set(my_frozendict, >>> key, value)). >> It is also possible to use ctypes and violate even more invariants. >> For most purposes, this falls under "consenting adults". > > My primary usage of frozendict would be pysandbox, a security module. > Attackers are not consenting adults :-) > > Read-only dict would also help optimization, in the CPython peephole > or the PyPy JIT. Not w.r.t. PyPy. It wouldn't do any harm though. One use of frozendict that you haven't mentioned so far is communication between concurrent processes/tasks. These need to be able to copy objects without changing reference semantics, which demands immutability. Cheers, Mark.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4