[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-06-12 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-06-02 Thread Nick Coghlan
Nick Coghlan added the comment: It *was* closed - I inadvertently reopened it with my comment. Fixed :) -- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed ___ Python tracker _

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-06-02 Thread alon horev
alon horev added the comment: after #14969 has closed, can this be closed? any more action items? -- ___ Python tracker ___ ___ Pytho

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-31 Thread Nick Coghlan
Nick Coghlan added the comment: Interesting - it turns out we can't fully reproduce the behaviour of nested with statements in ExitStack (see the new reference test I checked in, as well as #14969) I added one technically redundant variable to the implementation to make it more obviously cor

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset c0c7618762e5 by Nick Coghlan in branch 'default': Close #14963: Use an iterative algorithm in contextlib.ExitStack.__exit__ (Patch by Alon Horev) http://hg.python.org/cpython/rev/c0c7618762e5 -- resolution: -> fixed stage: test needed ->

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset fc73e6ea9e73 by Nick Coghlan in branch 'default': Issue #14963: Added test cases for contextlib.ExitStack exception handling behaviour (Initial patch by Alon Horev) http://hg.python.org/cpython/rev/fc73e6ea9e73 -- nosy: +python-dev __

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-31 Thread alon horev
alon horev added the comment: that was indeed trickier, but overriding the __context__ attribute did the trick. -- Added file: http://bugs.python.org/file25770/14963.2.patch ___ Python tracker ___

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-30 Thread Nick Coghlan
Nick Coghlan added the comment: Sorry, I wasn't clear on what I meant by "chained correctly", and that's the part that makes this trickier than the way contextlib.nested did it. I'm referring to the __context__ attribute on exceptions that is set automatically when an exception occurs in anot

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-30 Thread alon horev
alon horev added the comment: The iterative approach turned out elegant and concise. It actually now resembeles the implementation of nested's __exit__. -- keywords: +patch nosy: +alonho Added file: http://bugs.python.org/file25763/14963.patch ___ Py

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-30 Thread Nick Coghlan
New submission from Nick Coghlan : The current implementation of contextlib.ExitStack [1] actually creates a nested series of frames when unwinding the callback stack in an effort to ensure exceptions are chained correctly, just as they would be if using nested with statements. It would be ni