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
Bug Report
I find this very similar to issue #5485.
I found myself using this flavor of idiom so as to not repeat myself when implementing comparison operations, etc.
To Reproduce
from operator import itemgetter class A: id_getter = itemgetter('this', 'that', 'other') def __init__(self, d): self.d = d def __hash__(self) -> int: return hash(self.id_getter(self.d)) a = A({'this': 1, 'that': 2, 'other': 'a', 'extra': 'b'}) hash(a)
Expected Behavior
No error
Actual Behavior
$ mypy example.py example.py:8: error: Too many arguments Found 1 error in 1 file (checked 1 source file)
I tried to annotate id_getter: ClassVar[Callable[[Dict], Tuple[int, int, str]]] but just got back an additional error
id_getter: ClassVar[Callable[[Dict], Tuple[int, int, str]]]
examply.py:8: error: Invalid self argument "A" to attribute function "id_getter" with type "Callable[[Dict[Any, Any]], Tuple[Any, ...]]"
Your Environment
$ mypy --version mypy 0.812
No flags or ini file.
The text was updated successfully, but these errors were encountered:
Fixed by #10548
Sorry, something went wrong.
No branches or pull requests
Bug Report
I find this very similar to issue #5485.
I found myself using this flavor of idiom so as to not repeat myself when implementing comparison operations, etc.
To Reproduce
Expected Behavior
No error
Actual Behavior
I tried to annotate
id_getter: ClassVar[Callable[[Dict], Tuple[int, int, str]]]
but just got back an additional errorYour Environment
No flags or ini file.
The text was updated successfully, but these errors were encountered: