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

Asun Friere afriere at
Wed Sep 17 04:03:49 CEST 2008

On Sep 16, 8:05 pm, Hrvoje Niksic <hnik... at> wrote:
> "Gabriel Genellina" <gagsl-... at> 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