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 # obj: f, g; f 29 if obj.f(): 30 obj.g() 31 return 2 32 33 c = C() 34 d = D() 35 e = E() 36 result1_2 = test_conditional(d) 37 38 # vim: tabstop=4 expandtab shiftwidth=4