execfile question

chajadan python at chajadan.net
Thu Feb 21 22:19:50 EST 2002


I'm not sure if I'm off the mark here, but I believed __del__ guaranteed 
that a particular method got called at the end of it's life.

Mind you, the end of its life, and the end of its scope can be two 
different things. But since I'm not coming from any documented knowledge, I 
know leave my thought with a question marking trialing behind...?

--chajadan

At 09:45 PM 2/20/02 -0800, Tim Roberts wrote:
>Kerim Borchaev <warkid at storm.ru> wrote:
>
> >Can someone explain why while running this script I don't see C.__del__
> >eventually called?
>
>Your object c isn't actually deleted until it gets garbage-collected.  In
>your case, no garbage collection happens until after your program has
>ended.  In that case, there is no sense in taking any further action.
>
>__del__ is not like a C++ destructor.  As I recall, there was a lengthy
>thread on this newsgroup last year on this topic, in which it was concluded
>there is no way for an object to guarantee that a particular method gets
>called at the end of its life.
>--
>- Tim Roberts, timr at probo.com
>   Providenza & Boekelheide, Inc.
>--
>http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list