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.

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 storch...@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,

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 ros...@gmail.com wrote: On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka storch...@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

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 mur...@gmail.com wrote: On Tue, May 27, 2014 at 4:05 AM, Chris Angelico ros...@gmail.com wrote: On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka storch...@gmail.com wrote: 26.05.14 10:59, raymond.hettinger написав(ла): +result =

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 storch...@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

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 storch...@gmail.com 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

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 mur...@gmail.com wrote: On Tue, May 27, 2014 at 4:05 AM, Chris Angelico ros...@gmail.com wrote: On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka storch...@gmail.com wrote: 26.05.14 10:59, raymond.hettinger