2011-07-05 | Paul Boddie | raw annotate files changeset graph | Introduced Instance() in place of None as a result and for the value of the active expression where no definitive object can be deduced. Made all Instance values compare equal to each other in order to avoid duplication in sets. Improved Constant comparisons. Fixed assignment counting where many values are provided in a single assignment. Added inspection support for conditional expressions (since they are used in the standard library). |
1 #!/usr/bin/env python 2 3 class C: 4 clsattr = 123 5 clsattr2 = 456 6 7 class D: 8 clsattr = 321 9 10 def f(cls, x): 11 cls.clsattr = 789 12 if x: 13 cls.clsattr2 = 234 14 15 f(C, 1) 16 f(D, 0) # prevent AttributeError 17 18 result1_789 = C.clsattr 19 result1_234 = C.clsattr2 20 result2_789 = D.clsattr 21 22 # vim: tabstop=4 expandtab shiftwidth=4