micropython

tests/attributes4.py

218:b8550c04e807
2009-05-18 Paul Boddie Fixed FillDefaults temporarily, but a proper get_operand method is required for the instruction. Enhanced test outputs and comments.
     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