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
Minimal examples
Mypy says I'm using parameterized generics in instance checks, but that's incorrect (playground):
from typing import SupportsIndex, SupportsInt _ConvertibleToInt = SupportsInt | SupportsIndex def f(o: object) -> None: if isinstance(o, _ConvertibleToInt): # error ...
The same error does not happen if there is no alias (playground):
def f(o: object) -> None: if isinstance(o, SupportsInt | SupportsIndex): # fine ...
...or if the alias is for one Protocol and not a union (playground):
Protocol
_ConvertibleToInt = SupportsInt def f(o: object) -> None: if isinstance(o, _ConvertibleToInt): # fine ...
A union of the same Protocol repeated twice still triggers this error (playground):
_ConvertibleToInt = SupportsInt | SupportsInt def f(o: object) -> None: if isinstance(o, _ConvertibleToInt): # error ...
Environment
--strict
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Minimal examples
Mypy says I'm using parameterized generics in instance checks, but that's incorrect (playground):
The same error does not happen if there is no alias (playground):
...or if the alias is for one
Protocoland not a union (playground):A union of the same
Protocolrepeated twice still triggers this error (playground):Environment
--strictThe text was updated successfully, but these errors were encountered: