Using s.sort([cmp[, key[, reverse]]]) to sort a list of objects based on a attribute

Miki miki.tebeka at
Sun Sep 9 08:34:45 CEST 2007

>   steps.sort(key = lambda s: s.time)
This is why attrgetter in the operator module was invented.
from operator import attrgetter

Miki <miki.tebeka at>

More information about the Python-list mailing list