Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments
At 06:52 AM 3/28/2009 -0500, Guido van Rossum wrote:
2. In addition to the "yield from" syntax for delegating to a subgenerator, also add new syntax for returning values from subgenerators so that the basic "return X" can continue to trigger SyntaxError.
Since option 2 would most likely lead to a bikeshed discussion of epic proportions, I'm currently a fan of option 1 ;)
Me too. It also seems option 2 doesn't help us decide what it should do: I still think that raising StopIteration(value) would be misleading to vanilla users of the generators.
Agreed. (I still think new syntax is a plus, though, as it helps to clearly signal both the intent to make the generator a "subtask" and the need to call it with yield-from. Readability counts.)
participants (1)
-
P.J. Eby