2011-02-25 | Paul Boddie | raw annotate files changeset graph | Fixed constant raw image generation to actually refer to the class of each constant. Referenced NoneType and NotImplementedType so that the standard constants can be generated. Added a __class__ attribute to function instances. Fixed exception raising so that __class__ is included in allocated exception instances. Fixed item retrieval from list fragments which had erroneously been changed to resemble tuple item retrieval. Fixed list fragment reference initialisation for list literals. Added start and end parameters to the RSVPMachine.show method. Added an up method to RSVPMachine as a complement to the step and run methods. |
1 #!/usr/bin/env python 2 3 """ 4 This test attempts to cause the recording of the usage of 'C' in the function 5 'f', alongside the expectation that 'D' might be used instead with the function 6 'g'. A guard cannot therefore be generated. Meanwhile, the method 'E.h' should 7 be eliminated. 8 """ 9 10 class C: 11 def f(self): 12 return 1 13 14 class D: 15 def g(self): 16 return 2 17 18 class E: 19 def h(self): # unused 20 return 3 21 22 def f(c): 23 if 1: 24 return c.f() 25 return c.g() 26 27 c = C() 28 d = D() 29 e = E() 30 result1_1 = f(c) 31 32 # vim: tabstop=4 expandtab shiftwidth=4