mypy version 0.910
Consider
d = {
'a': 'a',
'b': {
'c': 1
}
}
d['b']['d'] = 'b'
Feeding this to mypy results with
error: Unsupported target for indexed assignment ("Collection[str]")
Putting a side that mypy inferred the wrong type for d (it is clearly not a collection of strings), adding a very basic explicit type for d fixes this:
d: dict = {
... # same as above
}
Success: no issues found in 1 source file
I find this very peculiar. mypy should definitely be able to infer that d is a dict without d: dict.