micropython

tests/changed/modifier.py

578:d161d4ac7dc0
2012-07-06 Paul Boddie Added module global modification/invalidation upon imports. Reverted the separate module processing phases introduced in 8824b42d7b71. Established a mechanism for modifying module globals, updating Attr assignment statistics and recording each name. Changed the update method on the Attr class to use a separate assignments update method, fixing the number of assignments recorded. Changed the get_context and get_value methods on the Attr class to test the number of assignments as well as the length of the list of recorded values. Changed one of the tests to more thoroughly demonstrate the effects of global modification on attribute usage and constant value identification.
     1 #!/usr/bin/env python     2      3 import changed # access the package root     4      5 # Change x in the partially imported module.     6      7 changed.x = changed.D     8      9 # vim: tabstop=4 expandtab shiftwidth=4