micropython

tests/abandoned_attribute_usage.py

510:41b26d6cd7ea
2012-05-21 Paul Boddie Expanded the documentation, adding prerequisites, reports and roadmap sections. Updated the copyright information.
     1 #!/usr/bin/env python     2      3 """     4 This test attempts to cause the recording of the usage of 'C' in the function     5 'f'. Meanwhile, the methods 'D.g' and 'E.h' should be eliminated.     6 """     7      8 class C:     9     def f(self):    10         return 1    11     12 class D:    13     def g(self):    # unused    14         return 2    15     16 class E:    17     def h(self):    # unused    18         return 3    19     20 def f(c):    21     if 1:    22         return c.f()    23     else:    24         return 2    25     26 c = C()    27 d = D()    28 e = E()    29 result1_1 = f(c)    30     31 # vim: tabstop=4 expandtab shiftwidth=4