Guido van Rossum wrote: > Well argued. I suggest to go for option (1) -- make GeneratorExit > inherit from BaseException. We can do this starting 2.6. Feel free to > upload a patch to bugs.python.org. It actually took me a while to figure out why this use case was convincing, when the same idea had been rejected for 2.5. For anyone else as slow as me: in the hypothetical examples I posted before the release of 2.5, the yield could be moved to an else clause on the try-except statement without adversely affecting the semantics. The use case Chad presented here is different, because the exceptions to be handled are being passed back in via the yield expression - moving it would defeat the whole purpose of the exception handling. I'm sure the fact that the example comes from a real application rather than the 'what-if' generator in my brain helps a lot too :) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
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