Message149273
| Author |
rhettinger |
| Recipients |
nikratio, rhettinger |
| Date |
2011年12月12日.03:17:41 |
| SpamBayes Score |
2.8597604e-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: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 |
|