2009-05-24 | Paul Boddie | raw annotate files changeset graph | Moved logic from CheckFrame into separate CheckContext, CheckClassContext instructions used in a sequence of generated instructions. Fixed usage of the exception register in the RSVP machine. |
1 #!/usr/bin/env python 2 3 def e(x): pass 4 5 class C: 6 e = e 7 8 def test(self): 9 self.e() 10 11 class D: 12 e = C.e 13 14 def test(self): 15 self.e(1) # TypeError: unbound C.e needs C instance, not int 16 17 class E(C): 18 # e = C.e (via inheritance) 19 20 def test(self): 21 self.e() 22 23 c = C() 24 d = D() 25 e = E() 26 27 p = c.e # bound C.e 28 q = d.e # unbound C.e 29 r = e.e # bound E.e 30 31 # vim: tabstop=4 expandtab shiftwidth=4