blob: 72dc7b62769d7977a437ba94338463a200f49217 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# test that the GC can trace nested objects
try:
import gc
except ImportError:
print("SKIP")
raise SystemExit
# test a big shallow object pointing to many unique objects
lst = [[i] for i in range(200)]
gc.collect()
print(lst)
# test a deep object
lst = [[[[[(i, j, k, l)] for i in range(3)] for j in range(3)] for k in range(3)] for l in range(3)]
gc.collect()
print(lst)
|