4 ms·
> what do you do to protect resources when people forget to use with statement? In many cases it is perfectly reasonable to only allow context manager use. And
by blattimwind 8y ago
> what do you do to protect resources when people forget to use with statement?
In many cases it is perfectly reasonable to only allow context manager use. And if it isn't possible, offer explicit close() or dispose() interfaces, don't rely on __del__.