MCPcopy Index your code
hub / github.com/python/cpython / Ouch

Class Ouch

Lib/test/test_gc.py:429–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427
428 def test_trashcan(self):
429 class Ouch:
430 n = 0
431 def __del__(self):
432 Ouch.n = Ouch.n + 1
433 if Ouch.n % 17 == 0:
434 gc.collect()
435
436 # "trashcan" is a hack to prevent stack overflow when deallocating
437 # 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…