order of object desctruction
Marcin Matuszkiewicz
marcin at finisar.com
Tue Oct 28 18:04:34 EST 2003
I have moved a test of the xbert module to new file
import xbert
xb = xbert.xbert('xb')
print xb.Version()
And now there is no problem when calling __del__()
Marcin
bromden wrote:
> this is really tricky,
>
> if an imported module is still available within the __del__ method of
> some object seems to depend on implementation, version and a bit of luck
> (then it's all about timing, i think),
>
> so generally you should stick to the rule that "__del__() methods should
> do the absolute minimum needed to maintain external invariants" and use
> the conditional
>
More information about the Python-list
mailing list