def isOfType(start, goal): return ((type(start) is goal) or (isinstance(start, types.InstanceType) and start.__class__ is goal))