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

Class Ouch

Lib/test/test_gc.py:433–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431
432 def test_trashcan(self):
433 class Ouch:
434 n = 0
435 def __del__(self):
436 Ouch.n = Ouch.n + 1
437 if Ouch.n % 17 == 0:
438 gc.collect()
439
440 # "trashcan" is a hack to prevent stack overflow when deallocating
441 # very deeply nested tuples etc. It works in part by abusing the

Callers 1

test_trashcanMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_trashcanMethod · 0.68