Python code coverage for Lib/test/crashers/underlying_dict.py
# | count | content |
---|---|---|
1 | n/a | import gc |
2 | n/a | |
3 | n/a | thingy = object() |
4 | n/a | class A(object): |
5 | n/a | def f(self): |
6 | n/a | return 1 |
7 | n/a | x = thingy |
8 | n/a | |
9 | n/a | r = gc.get_referrers(thingy) |
10 | n/a | if "__module__" in r[0]: |
11 | n/a | dct = r[0] |
12 | n/a | else: |
13 | n/a | dct = r[1] |
14 | n/a | |
15 | n/a | a = A() |
16 | n/a | for i in range(10): |
17 | n/a | a.f() |
18 | n/a | dct["f"] = lambda self: 2 |
19 | n/a | |
20 | n/a | print(a.f()) # should print 1 |