Python code coverage for Lib/test/leakers/test_selftype.py
# | count | content |
---|---|---|
1 | n/a | # Reference cycles involving only the ob_type field are rather uncommon |
2 | n/a | # but possible. Inspired by SF bug 1469629. |
3 | n/a | |
4 | n/a | import gc |
5 | n/a | |
6 | n/a | def leak(): |
7 | n/a | class T(type): |
8 | n/a | pass |
9 | n/a | class U(type, metaclass=T): |
10 | n/a | pass |
11 | n/a | U.__class__ = U |
12 | n/a | del U |
13 | n/a | gc.collect(); gc.collect(); gc.collect() |