[Python-ideas] chdir context manager

Daniel Shahaf d.s at daniel.shahaf.name
Sat Jan 19 13:33:29 CET 2013


Joao S. O. Bueno wrote on Sat, Jan 19, 2013 at 10:17:57 -0200:
> Why not something along:
> 
> with temp_dir("/tmp"):
>     # things that perform in  /tmp
> 
> # directory is restored.
> 
> Of course that one function could do both things,
> depending ob wether a <dir> parameter is passed.
> 

+1




More information about the Python-ideas mailing list