-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Missing args callable #18990
New issue
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
base: master
Are you sure you want to change the base?
Missing args callable #18990
Changes from 31 commits
7ecb077
b61c9ba
3ff8f89
6b08c08
3930148
4b1d260
615f869
06f6b73
84e9bba
aad7793
ee5f4b9
2b38551
e8700fa
57d4dd2
cc4fcf3
e93c401
17ebfea
c4d3d0a
496db6a
e802b54
1ae0e62
6761e28
f9641dc
7244902
97b3730
a39cec1
23a001e
4badf10
96d250c
91703e5
b261fae
0c7b3ab
d9a86c0
a8cb4fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3566,3 +3566,29 @@ class Bar(Foo): | |
|
||
def foo(self, value: Union[int, str]) -> Union[int, str]: | ||
return super().foo(value) # E: Call to abstract method "foo" of "Foo" with trivial body via super() is unsafe | ||
|
||
[case testInvalidUnpack] | ||
from foo import bar # type: ignore[import-not-found] | ||
from typing import Any | ||
|
||
def g(x: Any): | ||
pass | ||
|
||
def baz(x: int): | ||
return bar(*x, **x) # E: Expected iterable as variadic argument # E: Argument after ** must be a mapping, not "int" | ||
|
||
def f1(x: int): | ||
return g(**x) # E: Argument after ** must be a mapping, not "int" | ||
|
||
def f2(x: list[int]): | ||
return g(*x) | ||
|
||
def f3(x: Any): | ||
return g(*x) | ||
|
||
from typing import Optional | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it need to be separated and not at the top? Why? |
||
def f4(x: Optional[int]): | ||
return g(*x) # E: Expected iterable as variadic argument | ||
|
||
def f(x: int): | ||
return g(*x) # E: Expected iterable as variadic argument |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,4 @@ class dict(Mapping[KT, VT]): | |
@overload | ||
def get(self, k: KT, default: Union[KT, T]) -> Union[VT, T]: pass | ||
def __len__(self) -> int: ... | ||
import _typeshed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's move this to the very top (even though that may affect line numbers in 1-2 existing tests, that's simple enough) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many questions here... First, why is this code block preceding a docstring?
Second, there's no special-cased "misc" typing construct, this simply shouldn't exist. But fortunately this whole block starting from
is_constructor_call = ...
line is... doing nothing? Is this some kind of merge artifact? I don't see any use of these newly declared variables.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you requested my review, this comment still applies - I don't see any reason for this whole block of code to exist...