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 A: 4 def a(self): 5 return self.x # x not defined in this class, provided in subclasses 6 7 class B(A): 8 x = 123 # x provided here 9 10 class C(A): 11 def __init__(self, x): 12 self.x = x # x provided here 13 14 b = B() 15 c = C(456) 16 17 p = b.a() 18 q = c.a() 19 20 result_123 = p 21 result_456 = q 22 23 # vim: tabstop=4 expandtab shiftwidth=4