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/053888.html below:

[Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanup

[Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanup [Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanupGuido van Rossum gvanrossum at gmail.com
Wed May 18 18:55:12 CEST 2005
[Phillip J. Eby]
> And there was much rejoicing in the land of the co-routiney people.  :)  +1000.
> 
> Should this maybe just be added to PEP 342?  To me, PEP 342 has always
> seemed incomplete without ways to throw() and close(), but that could
> easily be just me.  In any case I'd expect the implementation of
> 'next(arg)' to have some overlap with the implementation of 'throw()'.

Maybe, but on the other hand this idea can be done independently from
PEP 342. After the "monster-PEP" 340, I'd rather break proposals up in
small parts.

> Also, if the generator yields a value upon close(), shouldn't that throw a
> runtime error?  Otherwise, you have no way to know the generator's
> exception handling is broken.

Maybe. But then what should happen when this happens to close()
invoked by the GC? I guess the same as when a __del__() method raises
an exception -- print a traceback and go on. OK, works for me.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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