Parent references: hot or not?

Dylan Reinhardt python at dylanreinhardt.com
Sat Apr 19 19:00:56 CEST 2003


On Sat, 2003-04-19 at 07:57, Jp Calderone wrote:
> > 4. It will be impossible to fully delete a non-empty Container.
> 
>   I'm not sure what "fully delete" means here.  The container will certainly
> be able to do "del self.items".  If "self.items" was the only reference to
> the items in the container, then the will all be collected by Python and
> de-allocated.

By that, I meant that if you deleted a non-empty Container, its Items
would still carry a reference to it.  You pretty much answered this
question in your response to my question about the potential for
recursive issues.

Sounds like I should be sure to write a __del__ method for Container
that ensures things work correctly.

Thanks for your comments,

Dylan







More information about the Python-list mailing list