For example, in the code:
a = [1, 2, 3, 4] # huge list
y = sum(a)
print( do_stuff(y) )
Will the memory for the list a ever get freed up before the program ends? Will the do_stuff function call have to do all its stuff with a constantly taking up memory, even though a's never going to be used again?
And if a doesn't get garbage collected, is the solution to manually set a=None once I'm done using it?