[python-advocacy] A minor nit with the code on the advocacy front page

Nick Coghlan ncoghlan at gmail.com
Tue Nov 21 11:15:36 CET 2006


The "Roster" function on the advocacy front page is currently a bit more 
complicated than it really needs to be. Consider this shorter alternative:

   def Roster(people):
     "Return a list of person objects, sorted by last name"

     def last_name(person):
         return person.last_name
     return sorted(people, key=last_name)

The actual code example pages look good, though :)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Advocacy mailing list