Lichen

tests/inheritance.py

292:436d7832ca66
2016-12-01 Paul Boddie Introduced the itemaccess class as the base of sequence types and strings. Added support for obtaining substrings from strings. Added tests of string operations. Removed the superfluous _tuple function from the sequence module.
     1 class C:     2     a = 1     3     b = 2     4      5 class D(C):     6     pass     7      8 def f():     9     C.a = 3     # only changes C.a, not D.a    10     11 print C.a       # 1    12 print D.a       # 1    13 print C.b       # 2    14 print D.b       # 2    15     16 f()    17     18 print C.a       # 3    19 print D.a       # 1