[Python-Dev] cpython: Minor clean-ups for heapq.
Chris Angelico
rosuav at gmail.com
Tue May 27 11:05:56 CEST 2014
More information about the Python-Dev mailing list
Tue May 27 11:05:56 CEST 2014
- Previous message: [Python-Dev] cpython: Minor clean-ups for heapq.
- Next message: [Python-Dev] cpython: Minor clean-ups for heapq.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka <storchaka at gmail.com> wrote: > 26.05.14 10:59, raymond.hettinger написав(ла): >> >> + result = [(elem, i) for i, elem in zip(range(n), it)] > > > Perhaps it is worth to add simple comment explaining why this is not > equivalent to just list(zip(it, range(n))). Otherwise it can be > unintentionally "optimized" in future. > Where is the difference? I'm very much puzzled now. My first thought was based on differing-length iterables in zip, but the docs say it stops at the shortest of its args. ChrisA
- Previous message: [Python-Dev] cpython: Minor clean-ups for heapq.
- Next message: [Python-Dev] cpython: Minor clean-ups for heapq.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list