1# test bytearray + bytearray 2 3b = bytearray(2) 4b[0] = 1 5b[1] = 2 6print(b + bytearray(2)) 7 8# inplace add 9b += bytearray(3) 10print(b) 11 12# extend 13b.extend(bytearray(4)) 14print(b) 15 16# this inplace add tests the code when the buffer doesn't need to be increased 17b = bytearray() 18b += b'' 19