MCPcopy Index your code
hub / github.com/RustPython/RustPython / __del__

Method __del__

Lib/test/test_gc.py:1152–1159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1150
1151 class GetObjectsOnDel:
1152 def __del__(self):
1153 nonlocal collected
1154 collected = True
1155 objs = gc.get_objects()
1156 # NB: can't use "in" here because some objects override __eq__
1157 for obj in objs:
1158 test.assertTrue(obj is not self)
1159 test.assertEqual(gc.get_referrers(self), [])
1160
1161 obj = GetObjectsOnDel()
1162 obj.cycle = obj

Callers

nothing calls this directly

Calls 3

get_objectsMethod · 0.80
assertTrueMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected