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
Describe the bug pyright: "TypeVar constraint type cannot be generic"
Code or Screenshots
from collections.abc import Hashable from typing import Protocol class HasIDField[K: Hashable](Protocol): id: K def __hash__(self) -> int: ... class Repository[K: Hashable, T: HasIDField[K]](Protocol): data: list[T] def get(self, key: K) -> T | None: return next((v for v in self.data if v.id == key), None)
VS Code extension or command-line pyright 1.1.360
pyright 1.1.360
Is this a bug or a wanted behaviour? (seems quite reasonable to me...)
The text was updated successfully, but these errors were encountered:
This is a limitation of the current type system, see python/typing#548 and https://github.com/nekitdev/peps/blob/main/peps/pep-9999.rst
Sorry, something went wrong.
No branches or pull requests
Describe the bug
pyright: "TypeVar constraint type cannot be generic"
Code or Screenshots
VS Code extension or command-line
pyright 1.1.360
Is this a bug or a wanted behaviour? (seems quite reasonable to me...)
The text was updated successfully, but these errors were encountered: