On Wed, 10 Feb 2010 23:03:29 -0500, Steve Holden wrote: >> intervals = sorted(intervals, key = lambda x: x[0]) > > Since Python uses lexical sorting and the intervals are lists isn't the > key specification redundant here?
Yes, but I wanted to make it explicit. Well, omitting the key= would change the sorting order in the event that multiple intervals have the same start, but it still won't affect the result of the function overall. -- http://mail.python.org/mailman/listinfo/python-list