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
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
|
|
|
class Foo:
|
2017-02-06 23:55:37 -05:00
|
|
|
def __del__(self):
|
2021-03-15 09:57:36 -04:00
|
|
|
print("__del__")
|
|
|
|
|
2017-02-06 23:55:37 -05:00
|
|
|
|
|
|
|
f = Foo()
|
|
|
|
del f
|
|
|
|
|
|
|
|
gc.collect()
|