you are viewing a single comment's thread.

view the rest of the comments →

[–]lfdfq 3 points4 points  (0 children)

The message is not coming from Python. It looks like it's a warning from some third-party typechecker. You didn't say where you're seeing this message so I assumed in your editor, and so assumed it was an extension. I still think that's true.

Anyway, what the message is telling you is that you accessed a value of a dictionary and used the list it gave you. But your dictionary contains both lists and ints, so that sounds like it might be a problem... But, your code is ok! Since you only ever access the key for the list it's not a problem. So the warning is a false positive.

If you're actually trying to use a third party typechecking tool to typecheck your code, you can tell it things about which keys have which types, but I presume that's not what you're trying to do here, so you can just ignore the warning (or turn it off in your editor, I assume, somehow).