E1137

Message

'variable_name' does not support item assignment (unsupported-assignment-operation)

Description

This statement is used when an item is assigned to a variable originally initialized to None

Explanation

Example

item = None

# Later initialize item to some dictionary

item['id'] = 5

Because item was originally initialized to a NoneType, assigning item['id'] is assumed to be invalid even though item could be assigned to a dictionary somewhere before it is used.

Instead try:

item = {}
...
item['id'] = 5

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License