2008-03-09 | Paul Boddie | raw annotate files changeset graph | Added an Instance class to indicate where instance accesses are being performed. Extended the Const class to hold empty parent/context details. Fixed function local name positions. Added a method to Function to determine whether an attribute is relocated for the class owning the function. Reverted the parameter initialisation "fix" (set_parameter) since parameters are unlikely to be single assignment candidates. Added explicit attribute finalisation in the image generation. Added a tentative optimisation for instance attributes (related to the is_relocated method mentioned above). Added incompatibility notes. |
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