The following code:
a = bytearray(b'abc')
a[1:2] = b'123'
works just fine on MicroPython and CircuitPython on the ESP8266, but fails with
TypeError: 'bytearray' object does not support item assignment
on the M0 boards. This is the fastest way to copy a fragment of a byte array (since it uses memcpy in C), but since it doesn't work consistently on all ports, I can't use it in my libraries. It would be nice if all ports supported it.
The following code:
works just fine on MicroPython and CircuitPython on the ESP8266, but fails with
TypeError: 'bytearray' object does not support item assignmenton the M0 boards. This is the fastest way to copy a fragment of a byte array (since it uses memcpy in C), but since it doesn't work consistently on all ports, I can't use it in my libraries. It would be nice if all ports supported it.