1 #!/usr/bin/env python 2 3 """ 4 This test attempts to record the usage of 'C', 'D' or 'E' in 'test_conditional' 5 since 'f' and 'g' might be used, but only 'f' is actually required. Although 6 only 'D' provides both attributes, classes 'C' and 'E' provide 'f'. 7 """ 8 9 class C: 10 def f(self): # unused but retained 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 but retained 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