Finding the name of a class
John Salerno
johnjsal at NOSPAMgmail.com
Tue Aug 1 12:03:04 EDT 2006
John Salerno wrote:
> Tim Chase wrote:
>
>> While this is surely true, would somebody explain why I had such
>> trouble finding this?
>
> I think __name__ is an attribute of the class itself, not the instance:
On the other hand:
>>> class Foo(object):
pass
>>> dir(Foo)
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__',
'__hash__', '__init__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__']
Hmmm.....
More information about the Python-list
mailing list