micropython

tests/attributes_class_copy_from_other.py

515:20ea2e9b841d
2012-06-03 Paul Boddie Restricted attribute assignments observed through usage analysis to instance attributes only.
     1 #!/usr/bin/env python     2      3 class C:     4     def method(self):     5         return 123     6      7 class D:     8     method = C.method # won't rebind to D     9     10 c = C()    11 d = D()    12 result_123 = c.method()    13 result2_123 = d.method(c) # need D instance to function    14     15 # vim: tabstop=4 expandtab shiftwidth=4