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

Class Counted

Lib/test/test_descr.py:1233–1238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

test_slotsMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_slotsMethod · 0.68