Thank you. So then, why does this work?
>>>> data = bytearray(b'abcdef')
>>>> data[0:1] = b'g'
>>>> data
bytearray(b'gbcdef')
I'll answer my own question. Because this is assignment, where as the first example is passing a slice into a function. It's treated differently. Not a copy when assigning. See http://stackoverflow.com/questions/10623...list-slice
>>>> data = bytearray(b'abcdef')
>>>> data[0:1] = b'g'
>>>> data
bytearray(b'gbcdef')
I'll answer my own question. Because this is assignment, where as the first example is passing a slice into a function. It's treated differently. Not a copy when assigning. See http://stackoverflow.com/questions/10623...list-slice