2012-02-27 | Paul Boddie | raw annotate files changeset graph | Added general attribute usage recording for attribute assignments on self, even though specific attribute usage is also recorded. This prevents usage from being inadvertently incomplete. Added tests demonstrating the contribution of attribute assignments to usage observations. |
1 #!/usr/bin/env python 2 3 class C: 4 def __init__(self, x): 5 self.x = x 6 self.z = None 7 8 class D: 9 def __init__(self, y): 10 self.y = y 11 self.z = None 12 13 def f(a): 14 if a.z: 15 pass 16 a.x = 3 17 18 c = C(1) 19 d = D(2) 20 f(c) 21 result_3 = c.x 22 23 # vim: tabstop=4 expandtab shiftwidth=4