Tuple arg for "classinfo" in isinstance: what does it mean?
Parzival Herzog
parz at shaw.SpamBucket.ca
Mon Dec 9 17:02:54 EST 2002
The Python Reference has the following to say about "isinstance"
isinstance(object, classinfo)
Return true if the object argument is an instance of the classinfo
argument, or of a (direct or indirect) subclass thereof. Also return true if
classinfo is a type object and object is an object of that type. If object
is not a class instance or a object of the given type, the function always
returns false. If classinfo is neither a class object nor a type object, it
may be a tuple of class or type objects, or may recursively contain other
such tuples (other sequence types are not accepted). If classinfo is not a
class, type, or tuple of classes, types, and such tuples, a TypeError
exception is raised. Changed in version 2.2: Support for a tuple of type
information was added.
So, from this, I know I am allowed to supply a tuple, but I have no idea at
all what such
a tuple argument means to the result of isinstance.
Can anyone supply the semantics? If you can, would you please tell me the
source reference for your information?
- Parzival
More information about the Python-list
mailing list