2008-03-09 | Paul Boddie | file changeset files shortlog | 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. |
paul@54 | 1 | This document describes various compatibility differences between micropython |
paul@54 | 2 | and other Python implementations. |
paul@54 | 3 | |
paul@54 | 4 | Class Attribute Assignment |
paul@54 | 5 | -------------------------- |
paul@54 | 6 | |
paul@54 | 7 | Python micropython |
paul@54 | 8 | ------ ----------- |
paul@54 | 9 | |
paul@54 | 10 | class C: |
paul@54 | 11 | ... |
paul@54 | 12 | |
paul@54 | 13 | # cls refers to C |
paul@54 | 14 | |
paul@54 | 15 | cls.attr = value Class attribute Run-time error |
paul@54 | 16 | assigned |
paul@54 | 17 | |
paul@54 | 18 | Module Attribute Assignment |
paul@54 | 19 | --------------------------- |
paul@54 | 20 | |
paul@54 | 21 | Python micropython |
paul@54 | 22 | ------ ----------- |
paul@54 | 23 | |
paul@54 | 24 | import somemod |
paul@54 | 25 | |
paul@54 | 26 | somemod.attr = value Module attribute Run-time error |
paul@54 | 27 | assigned |