isA function?

Alex Martelli aleax at aleax.it
Sat Jul 13 17:07:25 EDT 2002


Roy Smith wrote:

> Is there a standard isA() function in Python?  It should take two
> arguments, an instance and a class, and return true if the object is a
> member of the class or one of the class's ancestors.

Yep, it's spelled isinstance.

> I looked at the inspect module, and was surprised to not find it there.

It's a built-in.


Alex




More information about the Python-list mailing list