def issubclass_safe(x, klass):
 try:
  return issubclass(x, klass)
 except TypeError:
  return False

def issubclass_safe ( x , klass ) : try : return issubclass ( x , klass ) except TypeError : return False
return issubclass and return false on a typeerror .