Is this a bug with __del__()

Costas Menico costas at meezon.com
Thu May 24 16:27:22 EDT 2001


On Thu, 24 May 2001 19:31:23 GMT, "Fredrik Lundh"
<fredrik at pythonware.com> wrote:

>Costas Menico wrote:
>> Have you tired running it? Why does the "Delete called" show up before
>> the "program end"?
>
>does it?
>
>C:\>python script.py
>Program End
>Delete called
>
>$ python script.py
>Program End
>Delete called
>
>what python version / operating system / development environment
>are you using?

I should have mentioned it. I am using PythonWin version 2.1 on
windows 95 downloaded from ActiveState. 

I think PythonWin keeps the object around and when I run it the second
time I get the delete first and then the program end.

I wanted to use the __del__ method in a larger example class, (I
posted it before) to demo how to make class methods and variables.
Unfortunately no matter what I tried the __del__ was being invoked by
__init__.

Maybe someone could look at the example and let me know what I did
wrong.  It could also be, that it is not possible because of the way
the classes are code. 

The subject is: A new metaclass pattern, class methods 
Posted as a reply 5/23/01

Thanks for your help.

Costas



More information about the Python-list mailing list