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
Code taken straight from typing documentation (https://docs.python.org/3/library/typing.html#typing.Generic):
from typing import TypeVar, Mapping T = TypeVar('T') class MyDict(Mapping[str, T]): pass
Outcome (with both latest mypy from PyPI and development version):
% python -m mypy qwe.py qwe.py:5: error: Invalid type "qwe.T"
The text was updated successfully, but these errors were encountered:
IMO, the example is wrong, and should be class MyDict(Mapping[str, T], Generic[T]): ....
class MyDict(Mapping[str, T], Generic[T]): ...
Sorry, something went wrong.
In many cases Generic should be optional: https://www.python.org/dev/peps/pep-0484/#arbitrary-generic-types-as-base-classes
Generic
Closing as a duplicate of #302.
No branches or pull requests
Code taken straight from typing documentation (https://docs.python.org/3/library/typing.html#typing.Generic):
Outcome (with both latest mypy from PyPI and development version):
The text was updated successfully, but these errors were encountered: