Just as in:
f = Path.open('x') # SIM115 Use context handler for opening files
f.close()
Ruff nudges the user to use context managers, Ruff should do the same for:
from tempfile import NamedTemporaryFile
f = NamedTemporaryFile() # Should nudge SIM115
f.close()
and similarly for the other classes in tempfile.
Just as in:
Ruff nudges the user to use context managers, Ruff should do the same for:
and similarly for the other classes in
tempfile.