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 guard 'obj' in 'test_one' with only an instance check for 5 D instances. In the process, the unused methods should be discarded. 6 """ 7 8 class C: 9 def f(self): # unused 10 return 1 11 12 class D: 13 def f(self): 14 return 2 15 16 def __init__(self, g): 17 self.g = g 18 19 class E: 20 def f(self): # unused 21 return 4 22 23 def h(self): # unused 24 return 5 25 26 def test_one(obj): 27 # obj: f, g 28 obj.f() 29 return obj.g 30 31 c = C() 32 d = D(4) 33 e = E() 34 result1_4 = test_one(d) 35 36 # vim: tabstop=4 expandtab shiftwidth=4