A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-February/117033.html below:

[Python-Dev] Add a frozendict builtin type

[Python-Dev] Add a frozendict builtin type [Python-Dev] Add a frozendict builtin typeMark Shannon mark at hotpy.org
Tue Feb 28 10:47:59 CET 2012
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.
More information about the Python-Dev mailing list

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