[Python-Dev] Add a frozendict builtin type (original) (raw)
Victor Stinner victor.stinner at gmail.com
Fri Mar 2 12:36:05 CET 2012
- Previous message: [Python-Dev] Add a frozendict builtin type
- Next message: [Python-Dev] Add a frozendict builtin type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I think you should provide stronger arguments in each case why the data needs to be truly immutable or read-only, rather than just using _a convention or an "advisory" API (like private can be circumvented but clearly indicates intent to the reader).
I only know one use case for "truly immutable or read-only" object (frozendict, "read-only" type, read-only proxy, etc.): security. I know three modules using a C extension to implement read only objects: zope.proxy, zope.security and mxProxy. pysandbox uses more ugly tricks to implement read-only proxies :-) Such modules are used to secure web applications for example. A frozendict type doesn't replace these modules but help to implement security modules.
http://www.egenix.com/products/python/mxBase/mxProxy/ http://pypi.python.org/pypi/zope.proxy http://pypi.python.org/pypi/zope.security
Victor
- Previous message: [Python-Dev] Add a frozendict builtin type
- Next message: [Python-Dev] Add a frozendict builtin type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]