We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is more a question than a bug report per se.
Here it is.
I have the following code:
from typing import Any, Dict, TypedDict IndexContext = TypedDict("IndexContext", {"user": str}) def get_context() -> IndexContext: return {"user": "john"} def render(context: Dict[str, Any]) -> None: print(context) def main() -> None: context = get_context() render(context)
Here's what I get when running mypy:
$ mypy foo.py foo.py:17: error: Argument 1 to "render" has incompatible type "IndexContext"; expected "Dict[str, Any]" Found 1 error in 1 file (checked 1 source file)
I was expecting that mypy would not complain, because the IndexContext seems compatible with a plain Dict[str, Any]. Am I missing something ?
IndexContext
Dict[str, Any]
The text was updated successfully, but these errors were encountered:
Some context: typeddjango/django-stubs#355
Sorry, something went wrong.
Sorry, this is a duplicate of #4976 (I somehow missed it when I open this issue). Let's close this one.
No branches or pull requests
This is more a question than a bug report per se.
Here it is.
I have the following code:
Here's what I get when running mypy:
I was expecting that mypy would not complain, because the
IndexContext
seems compatible with a plainDict[str, Any]
. Am I missing something ?The text was updated successfully, but these errors were encountered: