Multiple sources lead me to believe that using a del
statement is rarely necessary. However, I am working on a program that needs to read in huge files ( 6 GB) with filename getting picked up from from a list, do some transformation, write them to a datastore and pick up the next file.
For instance the reference variables buffer
and processed
will get overwritten with every iteration of loop - is there a point to deleting them explicitly?
files = list() # contains 1000 filenames
for file in files:
buffer = read_from_s3(file)
processed = process_data(buffer)
del buffer # needed?
write_to_another_s3(processed)
del processed # needed?