micropython

tests/mixins.py

212:9cb85e5768fa
2009-05-09 Paul Boddie Added missing funccode to structures. Renamed function_from_method to as_instantiator with naming changes. Added a test of instantiation and keywords.
     1 #!/usr/bin/env python     2      3 class A:     4     def a(self):     5         return self.x     6      7 class B(A):     8     x = 123     9     10 class C(A):    11     def __init__(self, x):    12         self.x = x    13     14 b = B()    15 c = C(456)    16     17 p = b.a()    18 q = c.a()    19     20 # vim: tabstop=4 expandtab shiftwidth=4