def is_enum(obj):
 try:
  return issubclass(obj, enum.Enum)
 except TypeError:
  return False

def is_enum ( obj ) : try : return issubclass ( obj , enum . Enum ) except TypeError : return False
check if a given object is an enum .