Nick Coghlan wrote:
On Thu, Mar 8, 2012 at 9:52 PM, Mark Shannon <m...@hotpy.org> wrote:
First of all, the semantics described in the PEP do not match the tests.
If you substitute the supposedly semantically equivalent code
based on normal yields for each yield from in the test code
(Lib/test/test_pep380.py) and run it, then it fails.
What's more important is whether or not it matches the semantics of
inlining the subgenerator bodies. The expansion in the PEP was an
attempt to define a way to achieve that in current Python without
interpreter support.
So "yield from X" means "inline X here", if X is a generator.
That is much, much easier to understand than the big block of
code in the PEP.
It really ought say that "yield from" is equivalent to inlining
in the PEP.
Cheers,
Mark
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com