Tuple arg for "classinfo" in isinstance: what does it mean?

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Dec 10 04:13:37 EST 2002


"Parzival Herzog" <parz at shaw.SpamBucket.ca> wrote in news:iq8J9.132132$ea.2485788 at news2.calgary.shaw.ca:

> Can anyone supply the semantics? If you can, would you please tell me the
> source reference for your information?
Did you try looking at the docstring?

>>> help(isinstance)
Help on built-in function isinstance:

isinstance(...)
    isinstance(object, class-or-type-or-tuple) -> Boolean
    
    Return whether an object is an instance of a class or of a subclass thereof.
    With a type as second argument, return whether that is the object's type.
    The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for
    isinstance(x, A) or isinstance(x, B) or ... (etc.).



-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list