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