def _comparator(func):
 def comparator_wrapper(self, other):
  try:
   assert (self.enumtype == other.enumtype)
   result = func(self.index, other.index)
  except (AssertionError, AttributeError):
   result = NotImplemented
  return result
 comparator_wrapper.__name__ = func.__name__
 comparator_wrapper.__doc__ = getattr(float, func.__name__).__doc__
 return comparator_wrapper

def _comparator ( func ) : def comparator_wrapper ( self , other ) : try : assert ( self . enumtype == other . enumtype ) result = func ( self . index , other . index ) except ( AssertionError , AttributeError ) : result = NotImplemented return result comparator_wrapper . __name__ = func . __name__ comparator_wrapper . __doc__ = getattr ( float , func . __name__ ) . __doc__ return comparator_wrapper
decorator for enumvalue rich comparison methods .