1 #!/usr/bin/env python 2 3 """ 4 This test attempts to record the usage of 'D' in 'test_conditional' since 'f' 5 and 'g' are both normally required, and only 'D' provides these attributes. 6 Classes 'C' and 'E' should lose their methods, even 'E.f'. 7 """ 8 9 class C: 10 def f(self): # unused 11 return 1 12 13 class D: 14 def f(self): 15 return 2 16 17 def g(self): 18 return 3 19 20 class E: 21 def f(self): # unused 22 return 4 23 24 def h(self): # unused 25 return 5 26 27 def test_conditional(obj): 28 if obj.f(): 29 obj.g() 30 return 2 31 32 c = C() 33 d = D() 34 e = E() 35 result1_2 = test_conditional(d) 36 37 # vim: tabstop=4 expandtab shiftwidth=4