2008-05-18 | Paul Boddie | raw annotate files changeset graph | Revised the rules around attributes and contexts, based on new observations documented in the methods.py examples. Added a context attribute to Attr instances in order to properly simulate the revised rules. Added context changing as values are added to namespaces. Added missing context generation in invocation code generation. Tidied up the formatted representations of data objects. Fixed local variable positions. Tidied up Getattr processing when inspecting modules. Extended the tests to cover attribute access rules. |
1 This document describes various compatibility differences between micropython 2 and other Python implementations. 3 4 Class Attribute Assignment 5 -------------------------- 6 7 Python micropython 8 ------ ----------- 9 10 class C: 11 ... 12 13 # cls refers to C 14 15 cls.attr = value Class attribute Run-time error 16 assigned 17 18 Module Attribute Assignment 19 --------------------------- 20 21 Python micropython 22 ------ ----------- 23 24 import somemod 25 26 somemod.attr = value Module attribute Run-time error 27 assigned