1 #!/usr/bin/env python 2 3 """ 4 This test illustrates the need for propagation of usage to assignments providing 5 active name definitions. 6 """ 7 8 class C: 9 def f(self): 10 return 1 11 12 class D: 13 def f(self): 14 return 2 15 16 def g(self): 17 return 3 18 19 class E: 20 def f(self): 21 return 4 22 23 def h(self): # unused 24 return 5 25 26 def test_new(obj, obj2, obj3): 27 # obj should support f 28 if obj.f(): 29 obj = obj2 # should support f, g 30 obj.g() 31 else: 32 obj = obj3 # should support f, g 33 obj.g() 34 return obj.f() 35 36 c = C() 37 d = D() 38 e = E() 39 result2_2 = test_new(c, d, d) 40 41 # vim: tabstop=4 expandtab shiftwidth=4