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@96 | 1 | #!/usr/bin/env python |
paul@96 | 2 | |
paul@96 | 3 | import imported |
paul@96 | 4 | |
paul@242 | 5 | result_123 = imported.attr # cannot assign to this |
paul@96 | 6 | |
paul@96 | 7 | m = imported |
paul@242 | 8 | result1_10 = imported.a # can only read from the attribute, not replace it |
paul@242 | 9 | result2_10 = m.a # can only read from the attribute (m is known) |
paul@96 | 10 | |
paul@96 | 11 | # vim: tabstop=4 expandtab shiftwidth=4 |