[Python-ideas] Support other dict types for type.__dict__

Chris Rebert pyideas at rebertia.com
Fri Feb 24 00:51:22 CET 2012


On Thu, Feb 23, 2012 at 3:34 PM, Victor Stinner
<victor.stinner at haypocalc.com> wrote:
> 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.

And you can't use __slots__ because...?

Cheers,
Chris



More information about the Python-ideas mailing list