A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-March/087864.html below:

[Python-Dev] PEP 380 (yield from a subgenerator) comments

[Python-Dev] PEP 380 (yield from a subgenerator) comments [Python-Dev] PEP 380 (yield from a subgenerator) commentsP.J. Eby pje at telecommunity.com
Sat Mar 28 02:45:45 CET 2009
At 12:53 PM 3/28/2009 +1200, Greg Ewing wrote:
>Guido van Rossum wrote:
>
>>Perhaps the crux is that *if* you accidentally use "return <value>" in
>>a vanilla generator expecting the value to show up somewhere, you are
>>probably enough of a newbie that debugging this will be quite hard.
>>I'd like not to have such a newbie trap lying around.
>
>Okay, so would you be happy if the for-loop were to
>raise an exception if it gets a StopIteration whose
>value is not None?

Wouldn't it have to be more than just for-loops?  What about list(), 
map(), ...?

It seems a lot simpler to just make it use a different exception, as 
nothing else has to change for that to work correctly; the new 
construct can just catch it, and everywhere else it's an error.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4