Skip to content

Always complain about invalid varargs and varkwargs #18207

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

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
regression test
  • Loading branch information
hauntsaninja committed Nov 28, 2024
commit 50fdc080e81fdc464e3a1c8331edcdbb685f9ef2
8 changes: 5 additions & 3 deletions test-data/unit/check-varargs.test
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,19 @@ f(a, *(b, cc))
[builtins fixtures/tuple.pyi]

[case testInvalidVarArg]
# flags: --no-strict-optional
def f(a: 'A') -> None:
pass

class A: pass

a = None # type: A
a = A()

f(*None)
f(*None) # E: List or tuple expected as variadic arguments
f(*a) # E: List or tuple expected as variadic arguments
f(*(a,))

f(*4) # E: List or tuple expected as variadic arguments
f(a, *4)
[builtins fixtures/tuple.pyi]


Expand Down