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-March/117164.html below:

[Python-Dev] Add a frozendict builtin type

[Python-Dev] Add a frozendict builtin type [Python-Dev] Add a frozendict builtin typeSerhiy Storchaka storchaka at gmail.com
Thu Mar 1 15:17:35 CET 2012
01.03.12 11:29, André Malo написав(ла):
> - Caching. My data container objects (say, resultsets from a db or something)
>    usually inherit from list or dict (sometimes also set) and are cached
>    heavily. In order to ensure that they are not modified (accidentially), I
>    have to choices: deepcopy or immutability. deepcopy is so expensive, that
>    it's often cheaper to just leave out the cache. So I use immutability. (oh
>    well, the objects are further restricted with __slots__)

This is the first rational use of frozendict that I see. However, a deep 
copy is still necessary to create the frozendict. For this case, I 
believe, would be better to "freeze" dict inplace and then copy-on-write it.

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