[Python-Dev] Add a frozendict builtin type (original) (raw)

Alex Gaynor alex.gaynor at gmail.com
Tue Feb 28 02:20:34 CET 2012


Nick Coghlan <ncoghlan gmail.com> writes:

I'm pretty sure the PyPy jit can already pick up and optimise cases where a dict goes "read-only" (i.e. stops being modified).

No, it doesn't. We handle cases like a type's dict, or a module's dict, by having them use a different internal implementation (while, of course, still being dicts at the Python level). We do not handle the case of trying to figure out whether a Python object is immutable in any way.

Alex



More information about the Python-Dev mailing list