Author petr.viktorin
Recipients petr.viktorin
Date 2015-07-09.13:31:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When this program is invoked as a script (`python`), the __del__ is never called:


class ClassWithDel:
    def __del__(self):
        print('__del__ called')

a = ClassWithDel() = a

raise SystemExit(0)


Raising a different exception, moving the code to a function, importing the module, or invoking with -m (or even -c), causes __del__ to be called normally.
Date User Action Args
2015-07-09 13:31:32petr.viktorinsetrecipients: + petr.viktorin
2015-07-09 13:31:32petr.viktorinsetmessageid: <>
2015-07-09 13:31:32petr.viktorinlinkissue24596 messages
2015-07-09 13:31:32petr.viktorincreate