2013-06-29 | Paul Boddie | file changeset files shortlog | Separated handling of getattr attribute usage from normal program unit usage, tracking only newly introduced program constants when evaluating the effects of getattr usage, and thus limiting the amount of work done identifying new program units to investigate on each occasion. | syspython-as-target |
paul@417 | 1 | #!/usr/bin/env python |
paul@417 | 2 | |
paul@417 | 3 | class C: |
paul@417 | 4 | def clsattr(self): |
paul@417 | 5 | return 123 |
paul@417 | 6 | def clsattr2(self): |
paul@417 | 7 | return 456 |
paul@417 | 8 | |
paul@417 | 9 | def a(x): |
paul@417 | 10 | return 789 |
paul@417 | 11 | |
paul@417 | 12 | def b(x): |
paul@417 | 13 | return 234 |
paul@417 | 14 | |
paul@417 | 15 | C.clsattr = a |
paul@417 | 16 | C.clsattr2 = b |
paul@417 | 17 | |
paul@417 | 18 | c = C() |
paul@417 | 19 | |
paul@417 | 20 | result_789 = c.clsattr() |
paul@417 | 21 | result_234 = c.clsattr2() |
paul@417 | 22 | |
paul@417 | 23 | # vim: tabstop=4 expandtab shiftwidth=4 |