Changes between Version 2 and Version 3 of SortedIntThenAlpha


Ignore:
Timestamp:
Oct 22, 2006, 10:30:23 PM (18 years ago)
Author:
davidschein@…
Comment:

fixed mistake

Legend:

Unmodified
Added
Removed
Modified
  • SortedIntThenAlpha

    v2 v3  
    4343    """
    4444    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()])
    4747    return [item for (_sorter, item) in chain(sorted_ints, sorted_strs)]   
    4848}}}
Back to Top