Optimizing list processing

Stefan Behnel stefan_ml at behnel.de
Thu Dec 12 06:09:36 EST 2013


Terry Reedy, 12.12.2013 03:26:
> from itertools import count
> table = sorted(t for t in zip(iterable, count))

This is a useless use of a generator expression. sorted(zip(...)) is enough
(and likely to be substantially faster also).

Stefan





More information about the Python-list mailing list