micropython

tests/classes.py

207:79f8d72c8c78
2009-05-01 Paul Boddie Removed the instance attribute from DataObject (the common data structure), employing the presence of a value on the attrcode attribute to indicate the instance status of objects.
     1 #!/usr/bin/env python     2      3 class B:     4     pass     5      6 class A:     7     c0 = B     8     def __init__(self):     9         self.c2 = B    10     11 a = A()    12     13             # context on A attribute  context on a attribute    14 A.c0        # none                    none    15 a.c2        # N/A                     none    16     17 # vim: tabstop=4 expandtab shiftwidth=4