[Patches] [ python-Patches-1445739 ] New with semantics

SourceForge.net noreply at sourceforge.net
Wed Mar 8 16:50:55 CET 2006


Patches item #1445739, was opened at 2006-03-08 10:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1445739&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Guido van Rossum (gvanrossum)
Summary: New with semantics

Initial Comment:
Here's a patch that implements the new with statement
semantics: if __exit__ got passed an exception, it is
only swallowed when __exit__ returns *true*.  So it is
no longer necessary for __exit__ handlers to re-raise
the exception.

This is a bit rough still -- existing unit tests have
been adjusted, but there should be additional unit
tests for the new functionality.  Also the re-raise
code in various __exit__ handlers coded in the previous
patch could be removed (note that re-raising doesn't do
any harm -- it's just not necessary).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1445739&group_id=5470


More information about the Patches mailing list