2012-07-01 | Paul Boddie | raw annotate files changeset graph | Added support for value assignments in general attribute name declarations. Changed the handling of globals in functions to use general attribute name declarations (the assertion of a name being used in isolation) instead of attribute usage observations (where combinations of names are used to deduce more specific types). |
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