[Python-Dev] decorate-sort-undecorate

Neil Schemenauer nas-python at python.ca
Tue Oct 14 11:27:52 EDT 2003

On Mon, Oct 13, 2003 at 08:31:58PM -0700, Guido van Rossum wrote:
> But using Raymond's proposal, you can do that by specifying a tuple
> consisting of zipcode and name as the key, as follows:
>   myTable.sort(key = lambda rec: (rec.zipcode, rec.name))

This reads nicely.  +1 on 'key'.


More information about the Python-Dev mailing list