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

Class Counted

Lib/test/test_descr.py:1232–1237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1230
1231 # Test leaks
1232 class Counted(object):
1233 counter = 0 # counts the number of instances alive
1234 def __init__(self):
1235 Counted.counter += 1
1236 def __del__(self):
1237 Counted.counter -= 1
1238 class C(object):
1239 __slots__ = ['a', 'b', 'c']
1240 x = C()

Callers 1

test_slotsMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_slotsMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…