Getting a lexer error when modifying an array/list

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
cduran
Posts: 80
Joined: Thu Mar 17, 2016 4:52 pm

Getting a lexer error when modifying an array/list

Post by cduran » Tue May 09, 2017 3:47 pm

I am testing a simple script:

Code: Select all

def test9():
 test=call(0x23,0x04,0x16,0x00,0x00)
 test[10]=0x06
 test[14]=0x63
 call(0x20,test,0,0,0)
 return
test9()
the call(0x23,0x04,0x16,0x00,0x00) function returns a byte array created in my firmware using mp_obj_new_bytearray. I am getting a lexer memory error when I try to modify two items in the array test[10] and test[14]. I've made sure that the array being returned by call(0x23,0x04,0x16,0x00,0x00) has more than 14 bytes in the array.

Am I missing something? Can arrays passed into mp with mp_obj_new_bytearray be modified?

Post Reply