-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Labels
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.
tfleming-osr, huonw, A5rocks, GideonBear, kojiromike and 2 more