Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Rob Cliffe
On 27/05/2014 13:44, Tal Einat wrote: On Tue, May 27, 2014 at 2:45 PM, Michael Urman wrote: On Tue, May 27, 2014 at 4:05 AM, Chris Angelico wrote: On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka wrote: 26.05.14 10:59, raymond.hettinger написав(ла): +result = [(elem, i) for i, el

Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Raymond Hettinger
On May 27, 2014, at 1:58 AM, Serhiy Storchaka wrote: > 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. FWIW, that is covered by the test cases. If you substitute lis

Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Jonas Wielicki
On 27.05.2014 11:05, Chris Angelico wrote: > On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka 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 n

Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Tal Einat
On Tue, May 27, 2014 at 2:45 PM, Michael Urman wrote: > On Tue, May 27, 2014 at 4:05 AM, Chris Angelico wrote: >> On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka >> wrote: >>> 26.05.14 10:59, raymond.hettinger написав(ла): +result = [(elem, i) for i, elem in zip(range(n), it

Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Michael Urman
On Tue, May 27, 2014 at 4:05 AM, Chris Angelico wrote: > On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka 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

Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Chris Angelico
On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka 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))). Ot

Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Serhiy Storchaka
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.