2010-06-16 | Paul Boddie | file changeset files shortlog | Attempted to introduce a more conservative approach to visiting program units and collecting attributes. Moved the declaration of StopIteration into the inspection method for the "for" statement. Added module registration so that attribute collection successfully visits imported modules. |
paul@242 | 1 | #!/usr/bin/env python |
paul@242 | 2 | |
paul@242 | 3 | import imported |
paul@242 | 4 | |
paul@242 | 5 | class C: # hack: make an attribute called y known to the system |
paul@242 | 6 | y = None # hack: this prevents compilation errors with the statements |
paul@242 | 7 | # hack: below |
paul@242 | 8 | |
paul@242 | 9 | n = None |
paul@242 | 10 | n = imported |
paul@242 | 11 | n.a = 1 # not detected due to reassignment of n |
paul@242 | 12 | n.y = 2 # not detected due to reassignment of n |
paul@242 | 13 | n.y = 3 # not detected due to reassignment of n |
paul@242 | 14 | |
paul@242 | 15 | # vim: tabstop=4 expandtab shiftwidth=4 |