fork download
  1. from sys import exit
  2.  
  3. class Bar(object):
  4. def __init__(self):
  5. print("Bar1 init running")
  6. self.bar = self
  7.  
  8. def __del__(self):
  9. super().__del__()
  10. print("Destructor Bar")
  11.  
  12. b = Bar()
  13. exit()
Success #stdin #stdout #stderr 0.07s 14112KB
stdin
Standard input is empty
stdout
Bar1 init running
stderr
Exception ignored in: <function Bar.__del__ at 0x14f80cb2e160>
Traceback (most recent call last):
  File "./prog.py", line 9, in __del__
AttributeError: 'super' object has no attribute '__del__'