Skip to content

Commit

Permalink
fix: "variable arguments" error wording (#12827)
Browse files Browse the repository at this point in the history
Fixes #12508
  • Loading branch information
relsunkaev committed May 21, 2022
1 parent a6166b2 commit 927a9ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mypy/messages.py
Expand Up @@ -944,7 +944,7 @@ def could_not_infer_type_arguments(self, callee_type: CallableType, n: int,
self.fail('Cannot infer function type argument', context)

def invalid_var_arg(self, typ: Type, context: Context) -> None:
self.fail('List or tuple expected as variable arguments', context)
self.fail('List or tuple expected as variadic arguments', context)

def invalid_keyword_var_arg(self, typ: Type, is_mapping: bool, context: Context) -> None:
typ = get_proper_type(typ)
Expand Down
8 changes: 4 additions & 4 deletions test-data/unit/check-varargs.test
Expand Up @@ -275,7 +275,7 @@ class CC(C): pass
a = None # type: A

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

def f(a: 'A') -> None:
Expand Down Expand Up @@ -544,9 +544,9 @@ if int():
if int():
b, b = f(b, b, *aa) # E: Argument 3 to "f" has incompatible type "*List[A]"; expected "B"
if int():
a, b = f(a, *a) # E: List or tuple expected as variable arguments
a, b = f(a, *a) # E: List or tuple expected as variadic arguments
if int():
a, b = f(*a) # E: List or tuple expected as variable arguments
a, b = f(*a) # E: List or tuple expected as variadic arguments

if int():
a, a = f(*aa)
Expand Down Expand Up @@ -758,5 +758,5 @@ bar(*good1)
bar(*good2)
bar(*good3)
bar(*bad1) # E: Argument 1 to "bar" has incompatible type "*I[str]"; expected "float"
bar(*bad2) # E: List or tuple expected as variable arguments
bar(*bad2) # E: List or tuple expected as variadic arguments
[builtins fixtures/dict.pyi]

0 comments on commit 927a9ba

Please sign in to comment.