def is_class_instance(obj):
 try:
  cls = obj.__class__
 except AttributeError:
  return False
 else:
  return ((cls != type) and (not issubclass(cls, NOT_CLASS_TYPES)))

def is_class_instance ( obj ) : try : cls = obj . __class__ except AttributeError : return False else : return ( ( cls != type ) and ( not issubclass ( cls , NOT_CLASS_TYPES ) ) )
like inspect .