Given this example:
>>> x = [1, 2, 3]
>>> x = [1, 2]
Does the previous object that x is pointing to, the array of 1, 2, and 3, get destroyed by the garbage collector of Python? Or does it float around with nothing pointing at it?
Given this example:
>>> x = [1, 2, 3]
>>> x = [1, 2]
Does the previous object that x is pointing to, the array of 1, 2, and 3, get destroyed by the garbage collector of Python? Or does it float around with nothing pointing at it?