2012-06-30 | Paul Boddie | raw annotate files changeset graph | Added imported name storage (necessary where such names are not constant). Made a convenience method for storing working values as local names. Removed instance-related code where guards test for module types. Changed the _generateName method to perform scope discovery internally. |
1 #!/usr/bin/env python 2 3 class C: 4 def f(self): 5 return 1 6 def g(self): 7 return 2 8 9 class D: 10 def f(self): 11 return 0 12 13 def test(x): 14 if x.f() and x.g(): 15 return 3 16 else: 17 return 4 18 19 def test2(x): 20 if not x.f() or x.g(): 21 return 5 22 else: 23 return 6 24 25 c = C() 26 d = D() 27 result_4 = test(d) 28 result_5 = test2(d) 29 30 # vim: tabstop=4 expandtab shiftwidth=4