isA function?

Erik Max Francis max at alcyone.com
Sat Jul 13 17:07:29 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.

You want `isinstance'.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ See the son in your bad day / Smell the flowers in the valley
\__/ Chante Moore
    Bosskey.net: Aliens vs. Predator 2 / http://www.bosskey.net/avp2/
 A personal guide to Aliens vs. Predator 2.



More information about the Python-list mailing list