[Python-Dev] PEP 380 (yield from a subgenerator) comments
solipsis at pitrou.net
Sun Mar 22 16:09:27 CET 2009
Greg Ewing <greg.ewing <at> canterbury.ac.nz> writes:
> "When the iterator is another generator, the effect is the same as if
> the body of the subgenerator were inlined at the point of the ``yield
> from`` expression. Furthermore, the subgenerator is allowed to execute
> a ``return`` statement with a value, and that value becomes the value of
> the ``yield from`` expression."
If it's really enough to understand and debug all corner cases of using "yield
from", then fair enough.
(I still don't like the PEP and feel it's much too specialized for a new
syntactic feature. The language should try to be obvious rather than clever, IMO)
More information about the Python-Dev