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.00243918
Marked as misclassified No
Message-id <>
>     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:

I like unittest's addCleanup mechanism better.
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: <>
2011-12-22 08:47:12pitroulinkissue13585 messages
2011-12-22 08:47:12pitroucreate