I am writing a binary tree class. And i would like to delete the whole tree (all nodes in it) So i want to understand how to delete objects in python.
I have function del_obj(obj). I pass there "a" and it doesn't work correctly. As i suppose, it is copy of "a". But id method shows the same id. I am confused.
def del_obj(obj):
print(id(obj)) # 111
del obj
a = 3
print(id(a)) # 111
del_obj(a)
print(a) # 3