1 #!/usr/bin/env python 2 3 """ 4 This test attempts to record the usage of 'C', 'D' or 'E' in the module code 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 c = C() 28 d = D() 29 e = E() 30 31 obj = c 32 obj = d 33 # obj: f, g; f 34 if obj.f(): 35 x = obj.g() 36 else: 37 x = 2 38 39 result_3 = x 40 41 # vim: tabstop=4 expandtab shiftwidth=4