From 927a9ba05d7e1ca495c62e555b937e74a01c4e57 Mon Sep 17 00:00:00 2001 From: Ramazan Elsunakev <35545693+relsunkaev@users.noreply.github.com> Date: Fri, 20 May 2022 19:35:31 -0700 Subject: [PATCH] fix: "variable arguments" error wording (#12827) Fixes #12508 --- mypy/messages.py | 2 +- test-data/unit/check-varargs.test | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mypy/messages.py b/mypy/messages.py index 70d79384c1a9..b5f6ca339d6a 100644 --- a/mypy/messages.py +++ b/mypy/messages.py @@ -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) diff --git a/test-data/unit/check-varargs.test b/test-data/unit/check-varargs.test index d93618b85ba9..4dc10c9f7489 100644 --- a/test-data/unit/check-varargs.test +++ b/test-data/unit/check-varargs.test @@ -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: @@ -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) @@ -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]