Changes between Version 2 and Version 3 of SortedIntThenAlpha
- Timestamp:
- Oct 22, 2006, 10:30:23 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SortedIntThenAlpha
v2 v3 43 43 """ 44 44 key = attrgetter(attr) 45 sorted_ints = sorted([(int(key(item)),item) for item in items if item.name.isdigit()])46 sorted_strs = sorted([(key(item),item) for item in items if not item.name.isdigit()])45 sorted_ints = sorted([(int(key(item)),item) for item in items if key(item).isdigit()]) 46 sorted_strs = sorted([(key(item),item) for item in items if not key(item).isdigit()]) 47 47 return [item for (_sorter, item) in chain(sorted_ints, sorted_strs)] 48 48 }}}