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

[Python-Dev] with-statement heads-up

[Python-Dev] with-statement heads-up [Python-Dev] with-statement heads-upNick Coghlan ncoghlan at gmail.com
Tue Feb 28 22:57:52 CET 2006
Guido van Rossum wrote:
> I just realized that there's a bug in the with-statement as currently
> checked in. __exit__ is supposed to re-raise the exception if there
> was one; if it returns normally, the finally clause is NOT to re-raise
> it. The fix is relatively simple (I believe) but requires updating
> lots of unit tests. It'll be a while.

So does that mean with statements *will* be able to suppress exceptions now? 
(If I'm reading the PEP changes right it does, but I haven't finished my 
coffee yet. . .)

I'm not complaining if that's so, as I think allowing it makes the operation 
of the statement both more useful and more intuitive, but you were originally 
concerned about the potential for hidden flow control if the context manager 
could suppress exceptions, as well as the need to remember to write "raise" in 
the except clauses of context managers.

If you changed your mind along the way, that should probably be explained in 
the PEP somewhere :)

Cheers,
Nick

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
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