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 Peter.Norvig
Recipients Peter.Norvig, ezio.melotti, r.david.murray
Date 2012-05-18.04:22:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337314947.34.0.914428645143.issue14845@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with R. David Murray -- if "correct" means following the PEP 289 semantics, then

list(next(F) for _ in range(10))

should be the same as

def __gen(exp):
    for _ in exp:
        yield next(F)

list(__gen(iter(range(10))))

and indeed that is the case.  So the behvavior is correct and the documentation is both wrong, and rather informal/incomplete.
History
Date User Action Args
2012-05-18 04:22:27Peter.Norvigsetrecipients: + Peter.Norvig, ezio.melotti, r.david.murray
2012-05-18 04:22:27Peter.Norvigsetmessageid: <1337314947.34.0.914428645143.issue14845@psf.upfronthosting.co.za>
2012-05-18 04:22:26Peter.Norviglinkissue14845 messages
2012-05-18 04:22:26Peter.Norvigcreate