On Wed, Apr 27, 2011 at 5:39 AM, Mark Niemczyk <praham...@gmail.com> wrote: > (2) return [item[0] for item in lst] #relative > time: 106 > (5) return [x for (x,) in lst] > #relative time: 52
Interesting indeed. #5 will of course only work with a tuple of length 1, where most of the others are flexible enough to take the first element from any length tuple; but the time saving is quite significant. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list