does python have useless destructors?

"Martin v. Löwis" martin at v.loewis.de
Sun Jun 13 05:13:32 EDT 2004


Roger Binns wrote:
> Peter Hansen wrote:
> 
>>Do _you_ have a solution?  If you do and it really works,
>>it seems to me unlikely it would be ignored...
> 
> 
> I would do the same thing that shutdown does.  Run
> the destructors, but don't delete the underlying
> memory.  Set all the fields to None (just as shutdown
> points modules at None).  Finally in a second round
> actually free the memory.

At what point would you do the shutdown, and to what
objects would you apply it?

"the same thing as shutdown" means that you clear out
all modules. If the answer to the first question is
"at the end of the function", then any Python application
will crash as soon as the first function returns, as
then all modules will be useless.

Regards,
Martin




More information about the Python-list mailing list