2014-06-01 | Paul Boddie | raw annotate files changeset graph | Fixed a docstring to describe the method's actual return value. | syspython-as-target |
1 #!/usr/bin/env python 2 3 class C: 4 def __init__(self, a): 5 self.a = a 6 7 class D: 8 def __init__(self, a): 9 self.a = a 10 self.b = 0 11 12 def f(obj, b): 13 # Should fail when isinstance(obj, C). 14 obj.b = b 15 16 c = C(1) 17 # Should fail due to subsequent usage. 18 d = D(3) 19 f(c, 2) 20 result_1 = c.a 21 result_2 = c.b 22 23 # vim: tabstop=4 expandtab shiftwidth=4