Closed
Description
As mentioned in #25, this library currently allows writing multiple memory locations by using the syntax fram[0] = [0,1,2,3]
which behaves inconsistently from other Python usage, where this would attempt to store [0,1,2,3]
in position [0]
of fram
. This should be changed to something more like fram[0:3] = [0,1,2,3]
to use slice notation.
The built in bytearray
provides a good reference example:
>>> foo = bytearray(4)
>>> foo[0] = [1,2,3,4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'list' object cannot be interpreted as an integer
>>> foo[0:3] = [1,2,3,4]
>>> foo
bytearray(b'\x01\x02\x03\x04\x00')
>>>
Metadata
Metadata
Assignees
Labels
No labels