remove warning about list as a value of dictionary

Viewed 43

i'm using python 2.7 on pycharm

sim_dict = dict()
sim_path = "sim1"
sim_dict[sim_path] = dict()
list_key = 1
sim_dict[sim_path][list_key] = [1,2,3]

for the above code, I get a warning, Expected type str

sim_dict[sim_path][list_key].append(sim_value)

and for this line I get Unresolved attribute reference append for type str

is there a way to tell pycharm that this is the right type?

Note, I don't want to ignore the warnings

0 Answers
Related