Raymond Hettinger <[email protected]> added the comment:
'''
Example code:
with CleanupManager() als mngr:
tmpdir = tempfile.mkdtemp()
mngr.register(shutil.rmtree(tmpdir)) <-- this makes the call right away
# do stuff with tmpdir
'''
The part of my note that should be clear is that the idea and code need to
prove itself before being added to the standard library. So far, there has
been zero demand for this and I've not seen code like it being used in the
wild. AFAICT, it is not demonstrably better than a straight-forward
try/finally.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13585>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com