Author kristjan.jonsson
Recipients kristjan.jonsson, ncoghlan, r.david.murray
Date 2013-08-08.00:09:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hi there.
suppression of exceptions from __enter__ hides local control flow by
blurring the boundaries between with and if statements.
I'm not sure what this means.  To me, it is a serious language design flaw that you can write a context manager, and it has a well known interface that you can invoke manually, but that you cannot take two existing context managers and assemble them into a nested one, correctly, however much you wiggle.
In my mind, allowing context managers to skip the managed body breaks new ground.  Both, by allowing this "combination" to be possible.  And also by opening up new and exciting applications for context managers.  If you saw Raymond's talk last Pycon, you should feel inspired to do new and exciting things with them.

the bug-magnet you speak of I already addressed in my patch with nested-delayed, more as a measure of completeness (address both the problems that old "nested" had.  The more serious bug (IMHO) is the suppression of __enter__ exceptions.
Date User Action Args
2013-08-08 00:09:59kristjan.jonssonsetrecipients: + kristjan.jonsson, ncoghlan, r.david.murray
2013-08-08 00:09:59kristjan.jonssonsetmessageid: <>
2013-08-08 00:09:59kristjan.jonssonlinkissue18677 messages
2013-08-08 00:09:58kristjan.jonssoncreate