2008-07-21 | Paul Boddie | raw annotate files changeset graph | Made module and class attribute storage forbidden via attribute access on objects, since this is not generally detectable at compile-time. (There would be a run-time test on other store instructions in order to protect guarantees about class and module attributes.) Added name-related instruction attributes to the Translation class. |
1 #!/usr/bin/env python 2 3 import imported 4 5 imported.attr = 456 # detected with warning 6 7 m = imported 8 imported.a = 9 # detected with warning 9 m.a = 8 # detected with warning (m is always imported) 10 11 imported.x = 1 # detected with warning (despite no collision) 12 13 n = None 14 n = imported 15 n.y = 2 # not detected due to reassignment of n 16 n.y = 3 # not detected due to reassignment of n 17 18 # vim: tabstop=4 expandtab shiftwidth=4