2010-09-13 | Paul Boddie | raw annotate files changeset graph | Added a special class for abandoned branch users dictionaries, preventing any usage being recorded after a branch is abandoned. Moved any else clauses for "for" and "while" loops into the loop branch during inspection, thus combining loop usage with the termination clause of each loop. Added various tests and notes. |
1 #!/usr/bin/env python 2 3 class C: 4 def f(self): 5 return 1 6 7 class D: 8 def f(self): 9 return 2 10 11 def g(self): 12 return 3 13 14 def test_loop(d): # d: f, g; g 15 for j in xrange(0, 10): 16 k = d.f() # d: f 17 # d: f, g (from else) 18 else: 19 k = d.g() # d: g 20 21 return k 22 23 c = C() 24 d = D() 25 26 result_3 = test_loop(d) 27 28 # vim: tabstop=4 expandtab shiftwidth=4