INNER CODE UNIT · Python
__eq__
mpenning/ciscoconfparse · ciscoconfparse/ccp_abc.py:147
def __eq__(self, val):
try:
## try / except is much faster than isinstance();
## I added hash_arg() inline below for speed... whenever I change
## self.__hash__() I *must* change this
# FIXME
return hash(str(self.linenum) + self.text) == hash(
str(val.linenum) + val.text
)
except Exception:
return False
# On BaseCfgLine()
@logger.catch(reraise=True)
def __gt__(self, val):
if self.linenum > val.linenum:
return True
return False