You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy complains about this code, saying that Argument 2 to "g" has incompatible type "dict[str, object]"; expected "Mapping[str, Sequence[tuple[str, str]] | Sequence[str] | str]"
If I remove the b key, then it works fine - apparently mypy can tell that context is a dict[str, str | list[str]] and thus compatible with the signature for g. But if I add the b key, it gives up and infers a generic dict[str, object] type, which is then incompatible with g.
Worth noting that the type is correctly inferred by Pylance integrated with vscode.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I have the following code:
mypy
complains about this code, saying thatArgument 2 to "g" has incompatible type "dict[str, object]"; expected "Mapping[str, Sequence[tuple[str, str]] | Sequence[str] | str]"
If I remove the
b
key, then it works fine - apparentlymypy
can tell that context is adict[str, str | list[str]]
and thus compatible with the signature forg
. But if I add theb
key, it gives up and infers a genericdict[str, object]
type, which is then incompatible withg
.Worth noting that the type is correctly inferred by
Pylance
integrated withvscode
.The text was updated successfully, but these errors were encountered: