return self["Rc"].value
+@_functools.total_ordering
class Operand:
def __init__(self, record, name):
self.__record = record
def __repr__(self):
return f"{self.__class__.__name__}({self.name})"
+ def __lt__(self, other):
+ if self.__class__ is not other.__class__:
+ return NotImplemented
+ return ((self.name < other.name) or (self.span < other.span))
+
+ def __eq__(self, other):
+ if self.__class__ is not other.__class__:
+ return NotImplemented
+ return ((self.name == other.name) and (self.span == other.span))
+
+ def __hash__(self):
+ return hash((self.name, self.span),)
+
@property
def name(self):
return self.__name