Message222898
It's a side effect of the hidden closure that provides the new scope for the iteration variable - that's an ordinary function object, so using yield or yield from turns it into a generator expression instead. Generator expressions are already generators, so using yield or yield from just adds more yield points beyond the implied ones.
I've never figured out a good way to document it - it's a natural consequence of the comprehension's closure. An explicit mention in the reference docs for comprehensions may be worth adding. |
|
Date |
User |
Action |
Args |
2014-07-13 01:19:13 | ncoghlan | set | recipients:
+ ncoghlan, gcewing, ezio.melotti, hakril |
2014-07-13 01:19:13 | ncoghlan | set | messageid: <1405214353.36.0.905439565168.issue21964@psf.upfronthosting.co.za> |
2014-07-13 01:19:13 | ncoghlan | link | issue21964 messages |
2014-07-13 01:19:12 | ncoghlan | create | |
|