Add __lt__ to Table to allow sorting

Refs #277
This commit is contained in:
Sym Roe
2019-02-25 09:20:09 +00:00
parent 8ea4ec3de8
commit c019e582bf
2 changed files with 33 additions and 0 deletions
+7
View File
@@ -329,6 +329,13 @@ class Table(object):
def __repr__(self):
return '<{} shape={}>'.format(self.__class__.__name__, self.shape)
def __lt__(self, other):
if self.page == other.page:
if self.order < other.order:
return True
if self.page < other.page:
return True
@property
def data(self):
"""Returns two-dimensional list of strings in table.