Author kristjan.jonsson
Recipients eric.snow, kristjan.jonsson, ncoghlan, r.david.murray
Date 2013-08-08.10:43:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375958587.67.0.887335458452.issue18677@psf.upfronthosting.co.za>
In-reply-to
Content
Using my latest patch, the ExitStack inline example can be rewritten:

with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception

becomes:
with nested(opened(fname) for fname in filenames) as files:
    do_stuff_with_files(files)
History
Date User Action Args
2013-08-08 10:43:07kristjan.jonssonsetrecipients: + kristjan.jonsson, ncoghlan, r.david.murray, eric.snow
2013-08-08 10:43:07kristjan.jonssonsetmessageid: <1375958587.67.0.887335458452.issue18677@psf.upfronthosting.co.za>
2013-08-08 10:43:07kristjan.jonssonlinkissue18677 messages
2013-08-08 10:43:07kristjan.jonssoncreate