[Tutor] Grouping based on attributes of elements in a List
Rafael Durán Castañeda
rafadurancastaneda at gmail.com
Wed Mar 30 09:13:59 CEST 2011
You are right, lambda lis: lis[1:3] would be more readable
2011/3/30 Sander Sweers <sander.sweers at gmail.com>
> On 30 March 2011 00:30, Alan Gauld <alan.gauld at btinternet.com> wrote:
> > Wouldn't you just return a tuple of the two elements?
> > Or am I missing something having jumped into the middle of the thread...
> Ah yes, you are correct. But imo reading "key=lambda l: (l, l,
> l)" (which would be needed to sort how the OP wanted) hurts my eyes
> ;-). Anyway, both options will work fine for the OP.
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor