Re: [Python-Dev] Request for clarification of PEP 380

2012-03-08 Thread Mark Shannon
Nick Coghlan wrote: On Fri, Mar 9, 2012 at 12:06 AM, Mark Shannon wrote: The text of the PEP seems to implicitly assume that all sub-iterators will be generators, so it is not clear on the above points. On the contrary, this question is explicitly addressed in the PEP: http://www.python.org/d

Re: [Python-Dev] Request for clarification of PEP 380

2012-03-08 Thread Nick Coghlan
On Fri, Mar 9, 2012 at 12:06 AM, Mark Shannon wrote: > > The text of the PEP seems to implicitly assume that all sub-iterators > will be generators, so it is not clear on the above points. On the contrary, this question is explicitly addressed in the PEP: http://www.python.org/dev/peps/pep-0380/#

[Python-Dev] Request for clarification of PEP 380

2012-03-08 Thread Mark Shannon
Hi, The scenario is this: A generator, G, has a non-generator sub-iterator, S, (ie G includes a "yield from S" experssion and S is not a generator) and either G.close() or G.throw(GeneratorExit) is called. In the current implementation, S.close() is called and, if that call raises an exception,