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
With the following
from itertools import groupby from typing import Iterator, Iterable, TypeVar, Callable, Tuple, Any X, Key = TypeVar('X'), TypeVar('Key') def sorted_groupby(sequence: Iterable[X], key: Callable[[X], Key]) -> Iterator[Tuple[Key, Iterator[X]]]: return groupby(sorted(sequence, key=key), key=key)
You'll get
a.py:4: error: "object" not callable a.py: note: In function "sorted_groupby": a.py:5: error: Invalid type "a.X" a.py:5: error: Invalid type "a.Key"
It would be nice if TypeVars didn't have restrictions compared to the full python syntax that can otherwise be used in non-typechecked code
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
The error message could be better in this case.
No branches or pull requests
With the following
You'll get
It would be nice if TypeVars didn't have restrictions compared to the full python syntax that can otherwise be used in non-typechecked code
The text was updated successfully, but these errors were encountered: