[Tutor] putting instance variables into a dict
Shuying Wang
shuying at gmail.com
Mon Jan 30 23:00:58 CET 2006
Hi,
That's more or less what I want. Thanks! Now I just need to figure out
metaclasses and poke around python's innards. :D
--Shuying
On 1/30/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
> It's an somewhat low-level detail that the attributes of a class instance
> can be accessed through a special __dict__ object:
> ######
<snip>
> >>> s = SomeClass(5)
> >>> s.__dict__
> {'n': 5}
> ######
More information about the Tutor
mailing list