#NEWLINE# def VerifyTypeClass( arg , argname , legalTypes , ltd , klass , errmsgExtra = '' ) : #NEWLINE# #INDENT# "Same, but if it's a class, verify it's a subclass of the right class.\n\n    arg, any, the argument.\n    argname, string, name of the argument.\n    legalTypes, list of type objects, the allowed types.\n    ltd, string, description of legal types (for error message).\n    klass, class, the parent class.\n    errmsgExtra, string, text to append to the error message.\n    Returns: None.\n    Exceptions: TypeError if 'arg' is the wrong type.\n    " #NEWLINE# VerifyType ( arg , argname , legalTypes , ltd , errmsgExtra ) #NEWLINE# if ( ( type ( arg ) == types . ClassType ) and ( not issubclass ( arg , klass ) ) ) : #NEWLINE# #INDENT# m = _errmsg ( argname , ltd , errmsgExtra ) #NEWLINE# raise TypeError ( m )