A very simple question

Arnaldo Riquelme ajr at dynacap.com
Thu Jul 31 21:13:36 EDT 2003


I'm getting familiar with Python and I have a simple question:

class abc:
    x = 100
    y = 200
    z = 300


ac = abc()

Shouldn't I have a attribute named __dict__ for ac that contains a
dictionary of all the variables?

Instead when I do:
print ac__dict__

I get an empty dictionary {}

However:

print abc.__dict__    works.

I'm missing something somewhere, can anyone please enlight me on this
matter.


Thanks


Arnaldo











More information about the Python-list mailing list