Is 'x' an instance of a new-style class?

Asun Friere afriere at yahoo.co.uk
Tue Sep 16 22:03:49 EDT 2008


On Sep 16, 8:05 pm, Hrvoje Niksic <hnik... at xemacs.org> wrote:
> "Gabriel Genellina" <gagsl-... at yahoo.com.ar> writes:
> > In Python you would write isinstance(x, object).
>
> It will return True for all Python objects (except perhaps those that
> fiddle with metaclasses), not only for instances of new-style classes.
>
Unlike say isinstance(x.__class__, type) which should distinguish
between instances of new and old-style classes.



More information about the Python-list mailing list