def isenumattribute(x):
 if (enum is None):
  return False
 return isinstance(x, enum.Enum)

def isenumattribute ( x ) : if ( enum is None ) : return False return isinstance ( x , enum . Enum )
check if the object is attribute of enum .