Function-level (indent-less) "with" to do cleanup when function exits
Discussions on Python.org
Function-level (indent-less) "with" to do cleanup when function exits
This is a suggestion for a minor Python syntax enhancement (to “with” statements), but it may not be of wide interest or there may be objections I haven’t considered. I often find myself wanting to have context-managed resources automatically cleanup upon exit from a function, but an indent of the entire function code seems ugly and pointless in this case. It’s also wasteful in the “indent” economy (–things are harder to follow the more indents there are). I don’t need to track or clean up the r...
0 comments
No comments yet.