3 ms·
This is currently true in CPython, but is not necessarily true in other implementations. It's good hygiene in python to use a `with` statement for this reason,
by Wilduck 12y ago
This is currently true in CPython, but is not necessarily true in other implementations. It's good hygiene in python to use a `with` statement for this reason, as well as helping to enforce that you don't accidentally hold on to a reference, and keep the file open.
I think that context managers in python are generally a very nice abstraction over these sorts of concepts, and it's cool to see how Rust is handling these problems very cleanly.