Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 927a9ba

Browse files
authored
fix: "variable arguments" error wording (#12827)
Fixes #12508
1 parent a6166b2 commit 927a9ba

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

mypy/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def could_not_infer_type_arguments(self, callee_type: CallableType, n: int,
944944
self.fail('Cannot infer function type argument', context)
945945

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

949949
def invalid_keyword_var_arg(self, typ: Type, is_mapping: bool, context: Context) -> None:
950950
typ = get_proper_type(typ)

test-data/unit/check-varargs.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class CC(C): pass
275275
a = None # type: A
276276

277277
f(*None)
278-
f(*a) # E: List or tuple expected as variable arguments
278+
f(*a) # E: List or tuple expected as variadic arguments
279279
f(*(a,))
280280

281281
def f(a: 'A') -> None:
@@ -544,9 +544,9 @@ if int():
544544
if int():
545545
b, b = f(b, b, *aa) # E: Argument 3 to "f" has incompatible type "*List[A]"; expected "B"
546546
if int():
547-
a, b = f(a, *a) # E: List or tuple expected as variable arguments
547+
a, b = f(a, *a) # E: List or tuple expected as variadic arguments
548548
if int():
549-
a, b = f(*a) # E: List or tuple expected as variable arguments
549+
a, b = f(*a) # E: List or tuple expected as variadic arguments
550550

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

0 commit comments

Comments
 (0)