micropython

Annotated tests/attributes_class_assignment_method.py

671:76bdd4381b66
2013-07-04 Paul Boddie Fixed operator and built-in function invocations to use the "apply" function. Added a proper translation of print statements. syspython-as-target
paul@417 1
#!/usr/bin/env python
paul@417 2
paul@417 3
class C:
paul@417 4
    def clsattr(self):
paul@417 5
        return 123
paul@417 6
    def clsattr2(self):
paul@417 7
        return 456
paul@417 8
paul@417 9
def a(x):
paul@417 10
    return 789
paul@417 11
paul@417 12
def b(x):
paul@417 13
    return 234
paul@417 14
paul@417 15
C.clsattr = a
paul@417 16
C.clsattr2 = b
paul@417 17
paul@417 18
c = C()
paul@417 19
paul@417 20
result_789 = c.clsattr()
paul@417 21
result_234 = c.clsattr2()
paul@417 22
paul@417 23
# vim: tabstop=4 expandtab shiftwidth=4