Initializing Member Variables
Robert Brewer
fumanchu at amor.org
Mon Mar 8 12:48:03 EST 2004
Boy did I mess up. I wrote:
> Your immediate issue is this: putting __dict = {} in the *class*
> declaration does not make a separate attribute for each *instance*; it
> merely makes a single attribute for the class. To create an attribute
> for the class, you must write code which--surprise, surprise--adds
> that attribute to the *instance*.
...when I should have written:
Your immediate issue is this: putting __dict = {} in the *class*
declaration does not make a separate attribute for each *instance*; it
merely makes a single attribute for the class. To create an attribute
for the INSTANCE, you must write code which--surprise, surprise--adds
^^^^^^^^
that attribute to the *instance*.
FuManChu
More information about the Python-list
mailing list