Whre is my object ??

Brian Quinlan brian at sweetapp.com
Tue Jun 3 20:33:53 EDT 2003


> I bet the base question is: Will my object be garbage-collected?

Didn't you ask the original question? Why do you have to guess about the
semantics of your own question?

> I mean once I delete it it is no more referenced, right?

Yes. However, in the example that you describe there is still a
reference inside the list.

> I can still manipulate it till it exist, because I have a pointer to
its
> instance, but when (and most of all if) python checks for bindings it
will
> find the object is not any more referenced to by any name.

The fact that it is not referenced by name is irrelevant. Python will
keep the object alive as long as it can be accessed in any manner (1).

(1) For the mega Python weennies: the exception is weak references,
which  
    will not keep an object alive.

Cheers,
Brian






More information about the Python-list mailing list