Lichen

Annotated tests/inheritance.py

775:c8ba74a474eb
2017-03-25 Paul Boddie Fixed method name.
paul@257 1
class C:
paul@257 2
    a = 1
paul@257 3
    b = 2
paul@257 4
paul@257 5
class D(C):
paul@257 6
    pass
paul@257 7
paul@257 8
def f():
paul@257 9
    C.a = 3     # only changes C.a, not D.a
paul@257 10
paul@257 11
print C.a       # 1
paul@257 12
print D.a       # 1
paul@257 13
print C.b       # 2
paul@257 14
print D.b       # 2
paul@257 15
paul@257 16
f()
paul@257 17
paul@257 18
print C.a       # 3
paul@257 19
print D.a       # 1