Introspection

Jarkko Torppa torppa at polykoira.megabaud.fi
Mon Feb 28 11:04:04 EST 2000


In article <38BA7310.C6968E6E at mindspring.com>, Chuck Esterbrook wrote:
>
>If I want a handle/pointer to an instance's class, how do I do that?

>>> class Pah:
...     pass
...
>>> p=Pah()
>>> p.__class__
<class __main__.Pah at 814c0>

>>>> class Foo:
>...     pass
>...
>>>> Foo.__name__
>'Foo'
>>>> dir(Foo)
>['__doc__', '__module__']
>>>>

If this is what you want what is wrong with ?
>>> Foo
<class __main__.Foo at .....>

-- 
 Jarkko Torppa                torppa at staff.megabaud.fi
  Megabaud Internet-palvelut



More information about the Python-list mailing list