Author rhettinger
Recipients nikratio, rhettinger
Date 2011-12-12.03:17:41
SpamBayes Score 2.85976e-05
Marked as misclassified No
Message-id <1323659862.04.0.108345523123.issue13585@psf.upfronthosting.co.za>
In-reply-to
Content
'''
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.
History
Date User Action Args
2011-12-12 03:17:42rhettingersetrecipients: + rhettinger, nikratio
2011-12-12 03:17:42rhettingersetmessageid: <1323659862.04.0.108345523123.issue13585@psf.upfronthosting.co.za>
2011-12-12 03:17:41rhettingerlinkissue13585 messages
2011-12-12 03:17:41rhettingercreate