micropython

tests/attributes4.py

222:d63a8400ce56
2009-05-24 Paul Boddie 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 class C:     4     def h(self):     5         self.m = self.f     6         return self.m # not known     7     def f(self): pass     8      9     def test(self):    10         self.f()    11         self.h()    12     13 class D:    14     f = C.f    15     def h(self):    16         self.m = self.f    17         return self.m # not known    18     19     def test(self):    20         self.f(2)    21         self.h()    22     23 class E(C):    24     def h(self):    25         self.m = self.f    26         return self.m # not known    27     28     def test(self):    29         self.f()    30         self.h()    31     32 c = C()    33 d = D()    34 e = E()    35     36 x = c.f # bound C.f   == c.h()    37 y = d.f # unbound C.f == d.h()    38 z = e.f # bound E.f   == e.h()    39     40 # vim: tabstop=4 expandtab shiftwidth=4