micropython

tests/attribute_access_constant.py

519:814bd122d84d
2012-06-04 Paul Boddie Updated the documentation to reflect class attribute assignment policies. Added tests to demonstrate class attribute rebinding.
     1 #!/usr/bin/env python     2      3 class C:     4     a = 123     5      6 a1 = C.a            # no need for usage tracking on C     7 f1 = a1.__add__     # no need for usage tracking on a1     8      9 c = C()    10 a2 = c.a    11 f2 = a2.__add__    12     13 result1_579 = f1(456)    14 result2_579 = f2(456)    15     16 # vim: tabstop=4 expandtab shiftwidth=4