Find class of an instance?

bruno.desthuilliers at gmail.com bruno.desthuilliers at gmail.com
Wed Aug 6 11:04:50 EDT 2008


On 6 août, 15:52, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:
> Heiko Wundram a écrit :
>
> > Am Mittwoch, den 06.08.2008, 08:44 -0400 schrieb Neal Becker:
> >> Sounds simple, but how, given an instance, do I find the class?
>
> > <inst>.__class__
>
> Works for new-style classes only. The "generic" way to go is to use
> type(obj).
>
> <op>
> Note that in both cases, what you'll get back is the class object, not
> the class name
> </op>

My.... I should shut up and check my facts :( Please everybody ignore
this brain fart.





More information about the Python-list mailing list