18 lines
242 B
Python
Raw Normal View History

2023-08-17 11:29:06 +08:00
del_times = 0
class Test:
def __del__(self):
global del_times
2023-08-17 13:53:46 +08:00
# print("del")
2023-08-17 11:29:06 +08:00
del_times += 1
def test_del():
t = Test()
assert del_times == 0
del t
assert del_times == 1
test_del()
print("PASS")