In the case of a chained method when opening a file, eg.:
indata = open(from_file).read()
Is it necessary (or possible) to close the file handle opened with the open()
function?
If not, is it best practice to instead do:
infile = open(from_file)
indata = infile.read()
infile.close()