This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Julian, eric.araujo, eric.snow, giampaolo.rodola, ncoghlan, nikratio, pitrou, rhettinger, smarnach
Date 2011-12-22.08:47:12
SpamBayes Score 0.0024391843
Marked as misclassified No
Message-id <1324543633.39.0.305509262673.issue13585@psf.upfronthosting.co.za>
In-reply-to
Content
>     with ContextStack() as stack:
>         files = [stack.enter_context(open(fname)) for fname in filenames]

I find this a bit distasteful. Cleaning up resources now needs something called a "ContextStack" and an "enter_context" method call. There's a bit too much terminology, and it looks like a poor man's equivalent of Go's "defer" statement:
http://blog.golang.org/2010/08/defer-panic-and-recover.html

I like unittest's addCleanup mechanism better.
History
Date User Action Args
2011-12-22 08:47:13pitrousetrecipients: + pitrou, rhettinger, ncoghlan, giampaolo.rodola, eric.araujo, nikratio, Julian, eric.snow, smarnach
2011-12-22 08:47:13pitrousetmessageid: <1324543633.39.0.305509262673.issue13585@psf.upfronthosting.co.za>
2011-12-22 08:47:12pitroulinkissue13585 messages
2011-12-22 08:47:12pitroucreate