Skip to content

Commit 7553fc0

Browse files
author
tgmaxson
committed
Move non-existant keys to the end of the list when sorting. This is more intuitive as you typically don't want none at the top.
1 parent a17530a commit 7553fc0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ase/db/table.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def select(self, query, columns, sort, limit):
9696
n = columns.index(sort.lstrip('-'))
9797

9898
def key(row):
99-
return row.values[n]
99+
x = row.values[n]
100+
return (x is None, x)
100101

101102
self.rows = sorted(self.rows, key=key, reverse=reverse)
102103

0 commit comments

Comments
 (0)