Message149273
'''
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. |
|
Date |
User |
Action |
Args |
2011-12-12 03:17:42 | rhettinger | set | recipients:
+ rhettinger, nikratio |
2011-12-12 03:17:42 | rhettinger | set | messageid: <1323659862.04.0.108345523123.issue13585@psf.upfronthosting.co.za> |
2011-12-12 03:17:41 | rhettinger | link | issue13585 messages |
2011-12-12 03:17:41 | rhettinger | create | |
|