Error using the Magic Method : setitem

I have problem with the setitem, it seems the second parameter was not recognized, so when I want to use it, arise the error.