frozendict

Chris Rebert clp2 at rebertia.com
Fri Feb 10 18:00:55 CET 2012


On Fri, Feb 10, 2012 at 8:53 AM, Nathan Rice
<nathan.alexander.rice at gmail.com> wrote:
<snip>
> Lets also not forget that knowing an object is immutable lets you do a
> lot of optimizations; it can be inlined, it is safe to convert to a
> contiguous block of memory and stuff in cache, etc.  If you know the
> input to a function is guaranteed to be frozen you can just go crazy.
> Being able to freeze(anyobject) seems like a pretty clear win.
> Whether or not it is pythonic is debatable.  I'd argue if the meaning
> of pythonic in some context is limiting, we should consider updating
> the term rather than being dogmatic.

It's been proposed previously and rejected:
PEP 351 -- The freeze protocol
http://www.python.org/dev/peps/pep-0351/

Cheers,
Chris



More information about the Python-list mailing list