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

Asun Friere afriere at yahoo.co.uk
Wed Sep 17 04:03:49 CEST 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