[Python-ideas] Support other dict types for type.__dict__
Victor Stinner
victor.stinner at haypocalc.com
Fri Feb 24 00:34:49 CET 2012
More information about the Python-ideas mailing list
Fri Feb 24 00:34:49 CET 2012
- Previous message: [Python-ideas] doctest (re-send to list)
- Next message: [Python-ideas] Support other dict types for type.__dict__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, I'm trying to create read-only objects using a "frozendict" class. frozendict is a read-only dict. I would like to use frozendict for the class dict using a metaclass, but type.__new__() expects a dict and creates a copy of the input dict. I would be nice to support custom dict type: OrderedDict and frozendict for example. It looks possible to patch CPython to implement this feature, but first I would like first to know your opinion about this idea :-) Victor
- Previous message: [Python-ideas] doctest (re-send to list)
- Next message: [Python-ideas] Support other dict types for type.__dict__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list