[Python-Dev] problem with recursive "yield from" delegation

Nick Coghlan ncoghlan at gmail.com
Thu Mar 8 15:11:15 CET 2012


On Thu, Mar 8, 2012 at 11:45 PM, Mark Shannon <mark at hotpy.org> wrote:
> It really ought say that "yield from" is equivalent to inlining
> in the PEP.

That's what the motivation section is about. There's also an entire
subsection called "The Refactoring Principle" that describes this
intent. However, we needed something more concrete to flesh out the
original implementation details, which is what the code equivalent was
designed to provide (it was also designed to point out that the days
of "you can just use a simple for loop" actually went away when PEP
342 was implemented).

Now, it may be that we fixed things during implementation that should
be reflected back into the formal semantic spec in the PEP - so if you
can point out specific cases where what we implemented doesn't match
the nominal behaviour, I'm open to updating the PEP accordingly. (Of
course, if there are any tests that fail solely due to the two known
differences in semantics that are already noted in the PEP, they don't
count).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list