[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please pass the word along if you get a chance :-) -- ___ Python tracker ___ ___ Python-bugs-lis

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Daniel, we need to sync-up on the meaning of marking a report as > "accepted". Traditionally it denotes an approved patch, not a agreement > > that the bug is valid. Woops! Thanks for the correction. For what it's worth, a quick search of issues with

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Max, thanks for reporting this. I've replaced the sample code, making it work correctly and more clearly showing the logic. See r85345 and r85346. Daniel, we need to sync-up on the meaning of marking a report as "accepted". Traditionally it denotes an a

Re: [issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Senthil Kumaran
On Fri, Oct 08, 2010 at 06:25:26PM +, Alexander Belopolsky wrote: > In this case, I wonder if "equivalent to" code should be added to the > section for enumerate() and map(). Also since any() and all() have > "equivalent to" code, I think min(), max() and sum() deserve it as > well. I think,

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Refuse the temptation to hypergeneralize ;-) Also refuse the temptation to double the size of the docs (more != better). In the case of min/max, the pure python versions may add some value in showing that the first match is what is returned. But the code

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Oct 7, 2010 at 3:37 PM, Raymond Hettinger wrote: .. > I'll update the docs with an equivalent that works and that has a comment > showing when the > StopIteration is raised and caught. > In this case, I wonder if "equivalent to" code should be a

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll update the docs with an equivalent that works and that has a comment showing when the StopIteration is raised and caught. -- ___ Python tracker __

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-07 Thread Max
Max added the comment: Personally, I find it impossible in some cases to understand exactly what a function does just from reading a textual description. In those cases, I always refer to the equivalent code if it's given. In fact that's the reason I was looking going the zip equivalent funct

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > I suggest removing the "equivalent to" code from the zip section and > replacing it with an example showing how to use zip with a for loop > similar to the example illustrating enumerate. +1 -- ___ Python tracke

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As Daniel pointed out, the "equivalent to" code in builtins section comes from 2.x itertools documentation where and equivalent generator definition is presented for each function. While these definitions are helpful when used for documenting a module

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-06 Thread Douglas Leeder
Changes by Douglas Leeder : -- nosy: +Douglas.Leeder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: -loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Note that the following variant where maps are replaced with list comprehensions seems to work: def zip(*iterables): # zip('ABCD', 'xy') --> Ax By

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-05 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: The code was taken from the itertools.izip documentation for Python 2, where it did work. In Python 2, next() raises StopIteration which is propagated up and causes the izip() to stop. In Python 3, map is itself a generator and the StopIteration terminate