2017-02-06 23:55:37 -05:00
|
|
|
"""
|
|
|
|
categories: Core,Classes
|
|
|
|
description: Special method __del__ not implemented for user-defined classes
|
|
|
|
cause: Unknown
|
|
|
|
workaround: Unknown
|
|
|
|
"""
|
|
|
|
import gc
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
|
|
|
|
class Foo:
|
2017-02-06 23:55:37 -05:00
|
|
|
def __del__(self):
|
2020-03-22 22:26:08 -04:00
|
|
|
print("__del__")
|
|
|
|
|
2017-02-06 23:55:37 -05:00
|
|
|
|
|
|
|
f = Foo()
|
|
|
|
del f
|
|
|
|
|
|
|
|
gc.collect()
|