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.)

_______________________________________________
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

Reply via email to