2016-11-27 | Paul Boddie | file changeset files shortlog | Return class names for string representations, making instance representations more verbose. |
paul@2 | 1 | def f(): |
paul@2 | 2 | l = [1, 2, 3] |
paul@2 | 3 | x = l |
paul@2 | 4 | a, b, c = l |
paul@2 | 5 | d, e, f = [1, 2, 3] |
paul@243 | 6 | print a, b, c # 1, 2, 3 |
paul@243 | 7 | print d, e, f # 1, 2, 3 |
paul@243 | 8 | print x # [1, 2, 3] |
paul@2 | 9 | |
paul@2 | 10 | def g(x): |
paul@2 | 11 | l = [1, 2, 3] |
paul@2 | 12 | m = [4, l, 6] |
paul@2 | 13 | if x: |
paul@2 | 14 | n = l |
paul@2 | 15 | else: |
paul@2 | 16 | n = m |
paul@173 | 17 | print n |
paul@2 | 18 | |
paul@197 | 19 | f() |
paul@243 | 20 | g(0) # [4, [1, 2, 3], 6] |
paul@243 | 21 | g(1) # [1, 2, 3] |
paul@197 | 22 | |
paul@2 | 23 | l = [1, 2, 3] |
paul@2 | 24 | x = l |
paul@2 | 25 | a, b, c = l |
paul@2 | 26 | d, e, f = [1, 2, 3] |
paul@243 | 27 | print a, b, c # 1, 2, 3 |
paul@243 | 28 | print d, e, f # 1, 2, 3 |
paul@243 | 29 | print x # [1, 2, 3] |
paul@2 | 30 | m = [4, l, 6] |
paul@2 | 31 | if x: |
paul@2 | 32 | n = l |
paul@2 | 33 | else: |
paul@2 | 34 | n = m |
paul@243 | 35 | print n # [1, 2, 3] |