Closed heubi95 closed 9 years ago
Hints on implementing __eg__
and __lt__
: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
Rough implementation of InputLocation.__lt__()
:
def __lt__(self, other):
return (self.filePath < other.filePath) \
and (self.line < other.line) \
and (not self._hasColumn or (self.column < other.column)) \
and (not self._hasCell or (self.cell < other.cell)) \
and (not self._hasSheet or (self.sheet < other.sheet))
self._location = errors.InputLocation(cid_path, hasCell=True)
calladvanceLine()
for every row andadvanceCell()
for every column while parsing__str__
__unicode__
to__str__
__cmp__
function with__eq__
and__lt__