summaryrefslogtreecommitdiff
path: root/table.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-11-15 12:11:37 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-11-15 12:11:37 +0100
commit135b4141389138d95ad2c1a83a6a706f9758ceb6 (patch)
tree130bce997d5d6562db51f940f186f427b1779ee6 /table.py
parent2575a944af5839cf1bbafbdfe7f7f55478020014 (diff)
downloadlogilab-common-135b4141389138d95ad2c1a83a6a706f9758ceb6.tar.gz
2to3 has some more usable fixers
Diffstat (limited to 'table.py')
-rw-r--r--table.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/table.py b/table.py
index a81203d..398f1fc 100644
--- a/table.py
+++ b/table.py
@@ -100,10 +100,9 @@ class Table(object):
method should be in ('asc', 'desc')
"""
- sort_list = [(row[col_index], row, row_name)
- for row, row_name in zip(self.data, self.row_names)]
+ sort_list = sorted([(row[col_index], row, row_name)
+ for row, row_name in zip(self.data, self.row_names)])
# Sorting sort_list will sort according to col_index
- sort_list.sort()
# If we want reverse sort, then reverse list
if method.lower() == 'desc':
sort_list.reverse()