This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients Douglas.Leeder, belopolsky, docs@python, max, rhettinger, stutzbach
Date 2010-10-07.15:53:53
SpamBayes Score 2.5746027e-05
Marked as misclassified No
Message-id <1286466835.32.0.427565011987.issue10029@psf.upfronthosting.co.za>
In-reply-to
Content
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 oriented towards more advanced users, I doubt that exposing novices who are looking up builtins to the yield keyword and generators is a good idea.  The zip() example is particularly problematic.  Conceptually, zip is a very simple function, but the "equivalent to" code is not easy to decipher.   The reliance on StopIteration exception escaping from map to break out of the infinite loop is clever, but not obvious.  Moreover, as this bug demonstrates, this trick relies on subtle details that changed in 3.x.

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.
History
Date User Action Args
2010-10-07 15:53:55belopolskysetrecipients: + belopolsky, rhettinger, stutzbach, docs@python, Douglas.Leeder, max
2010-10-07 15:53:55belopolskysetmessageid: <1286466835.32.0.427565011987.issue10029@psf.upfronthosting.co.za>
2010-10-07 15:53:53belopolskylinkissue10029 messages
2010-10-07 15:53:53belopolskycreate