micropython

Annotated tests/call_method_via_class_internal.py

635:74ad0468297b
2013-01-15 Paul Boddie Added support for multiple class definitions in the same namespace with the same name. Made classes attribute users.
paul@208 1
#!/usr/bin/env python
paul@208 2
paul@208 3
class C:
paul@208 4
    def f(self, a, b, c):
paul@208 5
        C.h(self, a, b, c)
paul@208 6
paul@208 7
    def h(self, a, b, c):
paul@208 8
        self.a = a
paul@208 9
        self.b = b
paul@208 10
        self.c = c
paul@208 11
paul@208 12
c = C()
paul@208 13
c.f(1, 2, 3)
paul@230 14
result_1 = c.a
paul@230 15
result_2 = c.b
paul@230 16
result_3 = c.c
paul@208 17
paul@208 18
# vim: tabstop=4 expandtab shiftwidth=4