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
In this case the value type should int, but unfortunately I get this error:
main.py:18: error: Need type annotation for "value" [var-annotated]
main.py:18: error: Argument 2 to "ask" of "Menu" has incompatible type "list[dict[str, int]]"; expected "list[Option[Never]]" [arg-type]
I was working on some code that needs to be passed a generic TypedDict, like this:
And the usage would be this:
In this case the value type should
int
, but unfortunately I get this error:Playground: https://mypy-play.net/?mypy=latest&python=3.12&flags=verbose%2Cstrict&gist=9a8643b51a69f6d60ab5b0b482e10865
This seems to be working well in pyright 😊
Also I didn't find yet a workaround, changing the class to this:
Almost works, but for example in the case above it would infer the type as
object
😊The text was updated successfully, but these errors were encountered: