消息 [286408]
> 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:57 | levkivskyi | 修改 | recipients:
+ levkivskyi, gvanrossum, arigo, georg.brandl, rhettinger, belopolsky, benjamin.peterson, erickt, glyph, Inyeol.Lee, esc24, danielsh, emptysquare |
| 2017-01-28 11:28:57 | levkivskyi | 修改 | messageid: <1485602937.26.0.552045647376.issue10544@psf.upfronthosting.co.za> |
| 2017-01-28 11:28:57 | levkivskyi | 链接 | issue10544 messages |
| 2017-01-28 11:28:56 | levkivskyi | 创建 | |
|