__dict__s and types and maybe metaclasses...
Adam Atlas
adam at atlas.st
Wed May 2 19:20:09 EDT 2007
On May 2, 5:24 pm, Larry Bates <larry.ba... at websafe.com> wrote:
> I think that most people accomplish this by:
>
> class blah:
> __initial_values={'a': 123, 'b': 456}
>
> def __init__(self):
> self.__dict__.update(self.__initialvalues)
That's not really what I'm talking about... I'm talking about
replacing the __dict__ with a SUBCLASS of dict (not just default
values), and that's at the time of the class declaration (the creation
of `blah` as a `type` instance), not at instance creation.
More information about the Python-list
mailing list