1 #!/usr/bin/env python 2 3 class C: 4 def f(self): 5 return 1 6 7 class D: 8 def f(self): 9 return 2 10 11 def g(self): # unused 12 return 3 13 14 class E: 15 def f(self): 16 return 4 17 18 def h(self): 19 return 5 20 21 def test_new(obj): 22 # obj: C, D, E (f) 23 if obj.f(): # C, D, E (f) 24 obj2 = D() # obj2: E (h) -> conflict! 25 obj2.h() # E (h) 26 # else: 27 # ... # obj: C, D, E (f) 28 # # (f) ^ (f) 29 return obj.f() # C, D, E (f) 30 31 c = C() 32 d = D() 33 e = E() 34 result2_2 = test_new(c) 35 36 # vim: tabstop=4 expandtab shiftwidth=4