SelfCount/kunsar | SelfCount/Aleksyav | ||||
---|---|---|---|---|---|
f | 1 | class WeAre: | f | 1 | class WeAre: |
2 | count = 0 | 2 | count = 0 | ||
3 | 3 | ||||
4 | def __init__(self): | 4 | def __init__(self): | ||
5 | WeAre.count += 1 | 5 | WeAre.count += 1 | ||
6 | 6 | ||||
7 | def __del__(self): | 7 | def __del__(self): | ||
8 | WeAre.count -= 1 | 8 | WeAre.count -= 1 | ||
9 | 9 | ||||
t | 10 | t | |||
11 | # if __name__ == "__main__": | ||||
12 | # a = WeAre() | ||||
13 | # print(a.count) | ||||
14 | # b, c = WeAre(), WeAre(), | ||||
15 | # print(a.count, b.count, c.count) | ||||
16 | # del b | ||||
17 | # print(a.count) | ||||
18 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|