Message84288
I think this should just be closed.
The original implied claim that 3.0 is not correct is not correct. The
change of behavior is a clear side effect of and intended and documented
change in the semantics of comprehensions.
As near as I can tell, the results of the experiments are all correct
according to the doc for yield.
Python-list or the python-ideas list is more appropriate than the
tracker to discuss a semantic change. In any case, comprehensions are
function expressions, like lambda expressions, and expressions therein
should act much the same as the expression in a lambda expression.
Even if unclear, slightly insane, and not very useful, I do not think
yield should be prohibited in generators expression because
1) it would introduce a back-incompatibility in 3.1;
2) it would slightly break the parallelism with other comprehensions;
3) it would slightly break the parallelism with the expanded for-form;
4) such use is unlikely in real practice; and
5) it would raise the question of where else to prohibit yield. |
|
Date |
User |
Action |
Args |
2009-03-27 23:29:11 | terry.reedy | set | recipients:
+ terry.reedy, gvanrossum, pitrou, qwjqwj |
2009-03-27 23:29:11 | terry.reedy | set | messageid: <1238196551.56.0.182811730133.issue5577@psf.upfronthosting.co.za> |
2009-03-27 23:29:10 | terry.reedy | link | issue5577 messages |
2009-03-27 23:29:09 | terry.reedy | create | |
|