Show More
@@ -1,20 +1,20 b'' | |||||
1 | """Simple script to show reference holding behavior. |
|
1 | """Simple script to show reference holding behavior. | |
2 |
|
2 | |||
3 | This is used by a companion test case. |
|
3 | This is used by a companion test case. | |
4 | """ |
|
4 | """ | |
5 | from __future__ import print_function |
|
5 | from __future__ import print_function | |
6 |
|
6 | |||
7 | import gc |
|
7 | import gc | |
8 |
|
8 | |||
9 | class C(object): |
|
9 | class C(object): | |
10 | def __del__(self): |
|
10 | def __del__(self): | |
11 | pass |
|
11 | pass | |
12 | #print 'deleting object...' # dbg |
|
12 | #print 'deleting object...' # dbg | |
13 |
|
13 | |||
14 | if __name__ == '__main__': |
|
14 | if __name__ == '__main__': | |
15 | c = C() |
|
15 | c = C() | |
16 |
|
16 | |||
17 | c_refs = gc.get_referrers(c) |
|
17 | c_refs = gc.get_referrers(c) | |
18 | ref_ids = map(id,c_refs) |
|
18 | ref_ids = list(map(id,c_refs)) | |
19 |
|
19 | |||
20 | print('c referrers:',map(type,c_refs)) |
|
20 | print('c referrers:',list(map(type,c_refs))) |
General Comments 0
You need to be logged in to leave comments.
Login now