➜

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.

作者 ncoghlan
收信人 Inyeol.Lee, Jim Fasarakis-Hilliard, arigo, belopolsky, benjamin.peterson, danielsh, emptysquare, erickt, esc24, georg.brandl, glyph, gvanrossum, levkivskyi, ncoghlan, rhettinger, serhiy.storchaka
日期 2017-11-23.11:28:57
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1511436538.03.0.213398074469.issue10544@psf.upfronthosting.co.za>
In-reply-to
内容
Another slight variant to that test case to make sure the inner comprehension actually generates a closure reference in the current implementation:

    >>> [[x+y for x in range(2) for y in range(1, i)] for i in range(2, 5)]
    [[1, 2], [1, 2, 2, 3], [1, 2, 3, 2, 3, 4]]

These are the kind of challenges that drove of us towards the current implementation. While the status quo definitely has its downsides, those downsides at least all flow directly from "There's an implicit nested function there that you're not expecting".

Yury took all this into account when designing the interaction between `await` and comprehensions (which is why that's in a better state), but for `yield` we inherited the existing behaviour of any other nested function.
历史
日期 用户 动作 参数
2017-11-23 11:28:58ncoghlan修改recipients: + ncoghlan, gvanrossum, arigo, georg.brandl, rhettinger, belopolsky, benjamin.peterson, erickt, glyph, Inyeol.Lee, serhiy.storchaka, esc24, danielsh, emptysquare, levkivskyi, Jim Fasarakis-Hilliard
2017-11-23 11:28:58ncoghlan修改messageid: <1511436538.03.0.213398074469.issue10544@psf.upfronthosting.co.za>
2017-11-23 11:28:58ncoghlan链接issue10544 messages
2017-11-23 11:28:57ncoghlan创建