How to delete every reference of an object in Python?

Posted by Juanjo Conti on Stack Overflow See other posts from Stack Overflow or by Juanjo Conti
Published on 2010-06-10T09:48:27Z Indexed on 2010/06/10 11:43 UTC
Read the original article Hit count: 232

Filed under:

Supose you have something like:

x = "something"
b = x
l = [b]

How can you delete the object only having one reference, say x?

del x won't do the trick; the object is still reachable from b, for example.

© Stack Overflow or respective owner

Related posts about python