Closed as not planned
Description
m: Mapping[str, str]
v: Union[str, bytes]
if v in m:
m[v]
This produces:
Invalid index type "Union[str, bytes]" for "Mapping[str, str]"; expected type "str" [index]
But, we just checked that the value is in the mapping; so firstly, it most certainly is a valid index, but secondly, we can also infer that the variable is in fact str
type.