Assume I have these lines of code :
class Ab:
def __init__(self):
self.x = [i for i in range(1000)]
AbList = [Ab() for i in range(1000)]
for i in range(500):
AbList.pop()
Will python free up my memory after I popped the objects?
Assume I have these lines of code :
class Ab:
def __init__(self):
self.x = [i for i in range(1000)]
AbList = [Ab() for i in range(1000)]
for i in range(500):
AbList.pop()
Will python free up my memory after I popped the objects?
Python has a garbage collector that will free this memory after you'll delete the objects