Closed galqiwi closed 1 year ago
Code like list(open("./quora.txt")) leaks file descriptors, as it does not call .close() method on file. It's better to use it with with.
list(open("./quora.txt"))
.close()
with
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
您的邮件我已收到,将尽快回复!!
Code like
list(open("./quora.txt"))
leaks file descriptors, as it does not call.close()
method on file. It's better to use it withwith
.