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/2005-May/053815.html below:

[Python-Dev] PEP 343 - Abstract Block Redux

[Python-Dev] PEP 343 - Abstract Block Redux [Python-Dev] PEP 343 - Abstract Block ReduxPhillip J. Eby pje at telecommunity.com
Mon May 16 19:35:01 CEST 2005
At 09:53 PM 5/16/2005 +1000, Nick Coghlan wrote:

>My PEP punts on providing a general API for passing exceptions into 
>generators
>by making it an internal operation.

Actually, the proposals you made almost subsume PEPs 288 and 325.  All 
you'd need to do is:

1. move the '__del__' code to a 'close()' method and make __del__ call close()
2. make '_inject_exception()' a public API that returns the next yielded 
value if the exception doesn't propagate

And just like that you've cleaned up the open issues from both 288 and 325, 
IIRC those open issues correctly.

I personally think that StopIteration, TerminateIteration, 
KeyboardInterrupt and perhaps certain other exceptions should derive from 
some base class other than Exception (e.g. Raisable or some such) to help 
with the bare-except/except Exception problem.  But that's probably best 
addressed by a separate PEP.  :)

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