where is the __dict__ ?
Erik Max Francis
max at alcyone.com
Thu Sep 19 17:37:13 EDT 2002
black wrote:
> my book said all dictionaries have __dict__ method but couldnt find
> it by using dir(), where is it ?
Didn't you already ask this? Dictionaries do not have a __dict__
attribute (they're dictionaries already, why would they need one?), but
instances and classes do:
>>> class C: pass
...
>>> C.__dict__
{'__module__': '__main__', '__doc__': None}
>>> c = C()
>>> c.__dict__
{}
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ People are taught to be racists.
\__/ Jose Abad
Fauxident / http://www.alcyone.com/pyos/fauxident/
A "faux" ident daemon in Python
More information about the Python-list
mailing list