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/2006-August/068451.html below:

[Python-Dev] GeneratorExit is unintuitive and uneccessary

[Python-Dev] GeneratorExit is unintuitive and uneccessary [Python-Dev] GeneratorExit is unintuitive and uneccessaryPhillip J. Eby pje at telecommunity.com
Thu Aug 24 02:43:31 CEST 2006
At 01:44 AM 8/24/2006 +0200, Igor Bukanov wrote:
>Regarding yield in the finally problem:
>
>The current implementation throws RuntimeException after the yield
>transfer the control back to the close method. If that is changed to
>reporting a bad behavior and rethrowing GeneratorExit or its hidden
>analog as suggested at the point of yield inside the generator, that
>would nicely unwind possible outer finally blocks and close the
>generator in any case.

This approach has already been proposed and rejected multiple times.  A 
badly-behaving generator is broken and asking it to handle the error of its 
own brokenness will lead only to grief.  Once the generator yields 
inappropriately, it has proven it cannot be trusted.  It is only 
compounding the generator's insanity to ask it to handle this 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