➜

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.

作者 levkivskyi
收信人 Inyeol.Lee, arigo, belopolsky, benjamin.peterson, danielsh, emptysquare, erickt, esc24, georg.brandl, glyph, gvanrossum, levkivskyi, rhettinger
日期 2017-01-28.11:28:56
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1485602937.26.0.552045647376.issue10544@psf.upfronthosting.co.za>
In-reply-to
内容
> How about fixing CPython to raise SyntaxWarning or even SyntaxError?

I think it is better to just fix the issue, i.e. make comprehensions be equivalent to for-loops even if they contain `yield`. (In particular this will lead to [(yield i) for i in range(5)] be SyntaxError outside function).

The example of `await` shows that it is possible without leaking the loop variable into enclosing scope.
历史
日期 用户 动作 参数
2017-01-28 11:28:57levkivskyi修改recipients: + levkivskyi, gvanrossum, arigo, georg.brandl, rhettinger, belopolsky, benjamin.peterson, erickt, glyph, Inyeol.Lee, esc24, danielsh, emptysquare
2017-01-28 11:28:57levkivskyi修改messageid: <1485602937.26.0.552045647376.issue10544@psf.upfronthosting.co.za>
2017-01-28 11:28:57levkivskyi链接issue10544 messages
2017-01-28 11:28:56levkivskyi创建