SyntaxFix
Write A Post
Hire A Developer
Questions
As a side note, here is a better alternative to implement the same sorting:
alist.sort(key=lambda x: x.foo)
Or alternatively:
import operator alist.sort(key=operator.attrgetter('foo'))
Check out the Sorting How To, it is very useful.