Georg Brandl added the comment: For resource management, it would be more idiomatic to use context managers, either with multiple CMs in one with-statement or, dynamically, with contextlib.ExitStack.
For test suites using unittest, there is also the addCleanup functionality of the TestCase. (And if another test framework is used, it might have something similar, or maybe should grow it.) Anyway, such changes are not decided upon in the tracker. If you think this should go forward please discuss it on the python-ideas list. For it to go forward a PEP will likely need to be written. ---------- nosy: +georg.brandl _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21067> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com