Articles tagged context managers

I freaking love python's context managers. They's excellent for managing resources that need to have a set lifetime. I find myself writing lots of code that uses context managers like tempfile.NamedTemporaryFile and tempfile.TemporaryDirectory. Recently I found myself writing code that set up a data structure on ...

Read More

by Thomi Richards | Tue 02 June 2015 | Tags : python context managers code