2010-02-08 | Paul Boddie | file changeset files shortlog | Added control-flow branch abandonment for statements like break, continue, raise and return, preventing attribute usage from such branches from contributing to subsequent usage observations. Split the initial attribute usage test into smaller tests. Added notes about testing guard suitability. |
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 |