1 class A1: 2 def __init__(self): 3 self.b = [] 4 5 class A2: 6 def b(self): 7 return A3() 8 9 class A3: 10 c = [] 11 12 class A4: 13 def __getslice__(self, start=None, end=None, step=None): 14 return [] 15 def __getitem__(self, item): 16 return self 17 18 a = [1,2,3] 19 b = [4,5] 20 c = [6] 21 d = [] 22 e = 1 23 f = 2 24 25 a += b 26 27 a = A1() # May augment types since this is a global namespace. 28 a.b += c 29 a.b[e:] += d 30 31 a = A2() 32 a.b().c += d 33 34 a = A4() 35 a[e:f] += d 36 a[e] += c 37 a[e,f] += d 38 39 def f(): 40 a = [1,2,3] 41 b = [4,5] 42 c = [6] 43 d = [] 44 e = 1 45 f = 2 46 47 a += b 48 49 a = A1() 50 a.b += c 51 a.b[e:] += d 52 53 a = A2() 54 a.b().c += d 55 56 a = A4() 57 a[e:f] += d 58 a[e] += c 59 a[e,f] += d 60 61 f()