2011-06-14 | Paul Boddie | raw annotate files changeset graph | Fixed negation of operator method results in other operator methods. Added NotImplementedType as an automatically generated class. |
1 #!/usr/bin/env python 2 3 class C: 4 def f(self): 5 return 0 6 7 class D: 8 def f(self): 9 return 2 10 11 def g(self): 12 return 3 13 14 def test_conditional(obj): 15 # obj: f, g; f 16 if obj.f(): 17 return obj.g() 18 else: 19 return obj.f() 20 21 c = C() 22 d = D() 23 result1_0 = test_conditional(c) 24 25 # vim: tabstop=4 expandtab shiftwidth=4