micropython

Annotated tests/attributes_class_used_by_superclass.py

804:c967b47fada4
2014-06-01 Paul Boddie Merged branches. syspython-as-target
paul@294 1
#!/usr/bin/env python
paul@294 2
paul@526 3
# See mixins.py for a similar pattern.
paul@526 4
paul@294 5
class C:
paul@294 6
    def f(self):
paul@294 7
        return self.x
paul@294 8
paul@294 9
class D(C):
paul@294 10
    x = 456
paul@294 11
paul@294 12
d = D()
paul@294 13
result_456 = d.f()
paul@294 14
paul@294 15
# vim: tabstop=4 expandtab shiftwidth=4