From 58988cc405d7ca2b6088051e79d18aa62005931c Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Sat, 31 Jan 2026 17:07:28 +0900 Subject: [PATCH 01/30] Update error message for missing argument type annotation --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index cfeb27b1a5c99..67fd3319b37ed 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -127,7 +127,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: "Function is missing a return type annotation", codes.NO_UNTYPED_DEF ) ARGUMENT_TYPE_EXPECTED: Final = ErrorMessage( - "Function is missing a type annotation for one or more arguments", codes.NO_UNTYPED_DEF + "Function is missing a type annotation for one or more parameters", codes.NO_UNTYPED_DEF ) KEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE: Final = ErrorMessage( 'Keyword argument only valid with "str" key type in call to "dict"' From 416a76a4058c7e31dfe581fba466681bea5f4c35 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Sat, 31 Jan 2026 17:13:58 +0900 Subject: [PATCH 02/30] Update error messages for missing type annotations --- test-data/unit/check-flags.test | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test-data/unit/check-flags.test b/test-data/unit/check-flags.test index 94aae547882f2..5c77a3e81f0dd 100644 --- a/test-data/unit/check-flags.test +++ b/test-data/unit/check-flags.test @@ -8,7 +8,7 @@ main:2: error: Function is missing a type annotation # flags: --disallow-untyped-defs def f(x) -> int: pass [out] -main:2: error: Function is missing a type annotation for one or more arguments +main:2: error: Function is missing a type annotation for one or more parameters [case testNoArgumentFunction] # flags: --disallow-untyped-defs @@ -63,7 +63,7 @@ async def f(): # E: Function is missing a return type annotation \ [case testAsyncUnannotatedArgument] # flags: --disallow-untyped-defs -async def f(x) -> None: # E: Function is missing a type annotation for one or more arguments +async def f(x) -> None: # E: Function is missing a type annotation for one or more parameters pass [builtins fixtures/async_await.pyi] [typing fixtures/typing-async.pyi] @@ -830,7 +830,7 @@ import standard, incomplete def incomplete(x) -> int: return 0 [file incomplete.py] -def incomplete(x) -> int: # E: Function is missing a type annotation for one or more arguments +def incomplete(x) -> int: # E: Function is missing a type annotation for one or more parameters return 0 [file mypy.ini] \[mypy] @@ -847,7 +847,7 @@ import standard, incomplete def incomplete(x) -> int: return 0 [file incomplete.py] -def incomplete(x) -> int: # E: Function is missing a type annotation for one or more arguments +def incomplete(x) -> int: # E: Function is missing a type annotation for one or more parameters return 0 [file pyproject.toml] \[tool.mypy] @@ -1555,7 +1555,7 @@ def g(m: Movie) -> Movie: def f(i: int): # E: Function is missing a return type annotation pass -def g(i) -> None: # E: Function is missing a type annotation for one or more arguments +def g(i) -> None: # E: Function is missing a type annotation for one or more parameters pass def h(i: int) -> int: # no error return i @@ -1582,7 +1582,7 @@ def f(i: int, s): [out] main:3: error: Function is missing a return type annotation -main:3: error: Function is missing a type annotation for one or more arguments +main:3: error: Function is missing a type annotation for one or more parameters [case testDisallowIncompleteDefsAttrsNoAnnotations] # flags: --disallow-incomplete-defs @@ -1609,7 +1609,7 @@ class Annotated: import attrs @attrs.define -class PartiallyAnnotated: # E: Function is missing a type annotation for one or more arguments +class PartiallyAnnotated: # E: Function is missing a type annotation for one or more parameters bar: int = attrs.field() baz = attrs.field() From 8c5d9cb7bb359d8b9db09047769e2b916610b78b Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Sat, 31 Jan 2026 17:15:15 +0900 Subject: [PATCH 03/30] Fix type annotation error messages in tests --- test-data/unit/check-python38.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/check-python38.test b/test-data/unit/check-python38.test index 595ff95f44dcd..55895e9c6c2b4 100644 --- a/test-data/unit/check-python38.test +++ b/test-data/unit/check-python38.test @@ -116,7 +116,7 @@ def g(x: int): ... [case testPEP570ArgTypesMissing] # flags: --disallow-untyped-defs -def f(arg, /) -> None: ... # E: Function is missing a type annotation for one or more arguments +def f(arg, /) -> None: ... # E: Function is missing a type annotation for one or more parameters [case testPEP570ArgTypesBadDefault] def f(arg: int = "ERROR", /) -> None: ... # E: Incompatible default for argument "arg" (default has type "str", argument has type "int") From d29c114155d19bdf984e091f4b1d66469921e93e Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Sat, 31 Jan 2026 17:16:30 +0900 Subject: [PATCH 04/30] Fix type annotation error message in test --- test-data/unit/check-errorcodes.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test index 58f48144b3e56..c5bcf74b30920 100644 --- a/test-data/unit/check-errorcodes.test +++ b/test-data/unit/check-errorcodes.test @@ -382,7 +382,7 @@ def f(x): # E: Function is missing a type annotation [no-untyped-def] def g(x: int): # E: Function is missing a return type annotation [no-untyped-def] pass -def h(x) -> None: # E: Function is missing a type annotation for one or more arguments [no-untyped-def] +def h(x) -> None: # E: Function is missing a type annotation for one or more parameters [no-untyped-def] pass def gen(): # E: Function is missing a return type annotation [no-untyped-def] From a8946219c591a57cc7689af99d0983e39a39bdf3 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:10:24 +0900 Subject: [PATCH 05/30] Fix wording in error message for self parameter --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 67fd3319b37ed..1b8015673cda4 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -224,7 +224,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: # Self-type MISSING_OR_INVALID_SELF_TYPE: Final = ErrorMessage( - "Self argument missing for a non-static method (or an invalid type for self)" + "self parameter missing for a non-static method (or an invalid type for self)" ) ERASED_SELF_TYPE_NOT_SUPERTYPE: Final = ErrorMessage( 'The erased type of self "{}" is not a supertype of its class "{}"' From 5343adb5345135b42722b3aed4d6b368d376f570 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:15:00 +0900 Subject: [PATCH 06/30] Update check-classes.test --- test-data/unit/check-classes.test | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test-data/unit/check-classes.test b/test-data/unit/check-classes.test index 7fd96f9abf946..c458b59ba7d2d 100644 --- a/test-data/unit/check-classes.test +++ b/test-data/unit/check-classes.test @@ -7836,7 +7836,7 @@ def to_same_callable(fn: Callable[P, T]) -> Callable[P, T]: class A: def undecorated() -> None: ... # E: Method must have at least one argument. Did you forget the "self" argument? - def undecorated_not_self(x: int) -> None: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def undecorated_not_self(x: int) -> None: ... # E: self parameter missing for a non-static method (or an invalid type for self) def undecorated_not_self_2(self: int) -> None: ... # E: The erased type of self "builtins.int" is not a supertype of its class "__main__.A" @@ -7864,7 +7864,7 @@ class A: def g1() -> None: ... # E: Method must have at least one argument. Did you forget the "self" argument? @to_same_callable - def g2(x: int) -> None: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def g2(x: int) -> None: ... # E: self parameter missing for a non-static method (or an invalid type for self) @to_same_callable def g3(self: int) -> None: ... # E: The erased type of self "builtins.int" is not a supertype of its class "__main__.A" @@ -7909,7 +7909,7 @@ class A: return 0 @to_same_callable - def fn2(_x: int) -> int: # E: Self argument missing for a non-static method (or an invalid type for self) + def fn2(_x: int) -> int: # E: self parameter missing for a non-static method (or an invalid type for self) return 0 @to_same_callable @@ -7931,7 +7931,7 @@ class B: return 0 @remove_first - def fn3(self, _x: int) -> int: # E: Self argument missing for a non-static method (or an invalid type for self) + def fn3(self, _x: int) -> int: # E: self parameter missing for a non-static method (or an invalid type for self) return 0 @remove_first @@ -7965,15 +7965,15 @@ reveal_type(C().fn3) # N: Revealed type is "def (self: __main__.C, _x: builtins class D: @add_wrong_first - def fn1() -> int: # E: Self argument missing for a non-static method (or an invalid type for self) + def fn1() -> int: # E: self parameter missing for a non-static method (or an invalid type for self) return 0 @add_wrong_first - def fn2(_x: int) -> int: # E: Self argument missing for a non-static method (or an invalid type for self) + def fn2(_x: int) -> int: # E: self parameter missing for a non-static method (or an invalid type for self) return 0 @add_wrong_first - def fn3(self, _x: int) -> int: # E: Self argument missing for a non-static method (or an invalid type for self) + def fn3(self, _x: int) -> int: # E: self parameter missing for a non-static method (or an invalid type for self) return 0 reveal_type(D().fn1) # E: Invalid self argument "D" to attribute function "fn1" with type "Callable[[int], int]" \ @@ -7996,7 +7996,7 @@ def to_same_callable(fn: Callable[P, T]) -> Callable[P, T]: def unchecked(): class Bad: def fn() -> None: ... # E: Method must have at least one argument. Did you forget the "self" argument? - def fn2(x: int) -> None: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def fn2(x: int) -> None: ... # E: self parameter missing for a non-static method (or an invalid type for self) # TODO: would be nice to make this error, but now we see the func # being decorated as Any, not as a callable @@ -8017,12 +8017,12 @@ def unchecked(): def checked() -> None: class Bad: def fn() -> None: ... # E: Method must have at least one argument. Did you forget the "self" argument? - def fn2(x: int) -> None: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def fn2(x: int) -> None: ... # E: self parameter missing for a non-static method (or an invalid type for self) @to_same_callable def g() -> None: ... # E: Method must have at least one argument. Did you forget the "self" argument? @to_same_callable - def g2(x: int) -> None: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def g2(x: int) -> None: ... # E: self parameter missing for a non-static method (or an invalid type for self) class AlsoBad: def fn(): ... # E: Method must have at least one argument. Did you forget the "self" argument? From a9270842c5b32d76d9d0427918593971401e6aa0 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:16:13 +0900 Subject: [PATCH 07/30] Update check-selftype.test --- test-data/unit/check-selftype.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/check-selftype.test b/test-data/unit/check-selftype.test index fe1c903f06ea3..afed3fcb65c18 100644 --- a/test-data/unit/check-selftype.test +++ b/test-data/unit/check-selftype.test @@ -1058,7 +1058,7 @@ class A: def f(x: int) -> None: ... def g(self: None) -> None: ... [out] -main:3: error: Self argument missing for a non-static method (or an invalid type for self) +main:3: error: self parameter missing for a non-static method (or an invalid type for self) main:4: error: The erased type of self "None" is not a supertype of its class "__main__.A" [case testUnionPropertyField] From 1a7ac4f9b2a8188f71132aa1a4987f0aabebbaf2 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:18:07 +0900 Subject: [PATCH 08/30] Update check-overloading.test --- test-data/unit/check-overloading.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test-data/unit/check-overloading.test b/test-data/unit/check-overloading.test index 5a445c818218e..0d9ce42f148f7 100644 --- a/test-data/unit/check-overloading.test +++ b/test-data/unit/check-overloading.test @@ -4347,7 +4347,7 @@ class Wrapper2: @staticmethod def foo(x: int) -> int: ... @overload - def foo(x: str) -> str: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def foo(x: str) -> str: ... # E: self parameter missing for a non-static method (or an invalid type for self) @staticmethod def foo(x): pass @@ -4358,7 +4358,7 @@ class Wrapper3: @overload @staticmethod def foo(x: str) -> str: ... - def foo(x: Union[int, str]): pass # E: Self argument missing for a non-static method (or an invalid type for self) + def foo(x: Union[int, str]): pass # E: self parameter missing for a non-static method (or an invalid type for self) [builtins fixtures/staticmethod.pyi] [case testOverloadWithSwappedDecorators2] @@ -4394,7 +4394,7 @@ class Wrapper3: def foo(x: int) -> int: ... @overload - def foo(x: str) -> str: ... # E: Self argument missing for a non-static method (or an invalid type for self) + def foo(x: str) -> str: ... # E: self parameter missing for a non-static method (or an invalid type for self) @staticmethod def foo(x): pass From f5551e0690ba38d5c5e493c6365cc0b27ae1e8ea Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:54:14 +0900 Subject: [PATCH 09/30] Update message_registry.py --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 1b8015673cda4..0729a719cd936 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -309,7 +309,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: 'Syntax error in type comment "{}"', codes.SYNTAX ) ELLIPSIS_WITH_OTHER_TYPEARGS: Final = ErrorMessage( - "Ellipses cannot accompany other argument types in function type signature", codes.SYNTAX + "Ellipses cannot accompany other parameter types in function type signature", codes.SYNTAX ) TYPE_SIGNATURE_TOO_MANY_ARGS: Final = ErrorMessage( "Type signature has too many arguments", codes.SYNTAX From 62f220402107a098f9b0b6576d06c1dcf57e2bdf Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:55:15 +0900 Subject: [PATCH 10/30] Update check-functions.test --- test-data/unit/check-functions.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-functions.test b/test-data/unit/check-functions.test index a0762ab78f482..e34ad2b0d4eb3 100644 --- a/test-data/unit/check-functions.test +++ b/test-data/unit/check-functions.test @@ -2143,13 +2143,13 @@ class A: def f(x, y, z): # type: (..., int) -> None pass [out] -main:1: error: Ellipses cannot accompany other argument types in function type signature +main:1: error: Ellipses cannot accompany other parameter types in function type signature [case testEllipsisWithSomethingBeforeItFails] def f(x, y, z): # type: (int, ...) -> None pass [out] -main:1: error: Ellipses cannot accompany other argument types in function type signature +main:1: error: Ellipses cannot accompany other parameter types in function type signature [case testRejectCovariantArgument] from typing import TypeVar, Generic From 79f7b1126c0f4b24c0e86d845fd266fbd4d315ce Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 01:59:31 +0900 Subject: [PATCH 11/30] Update message_registry.py --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 0729a719cd936..6e8b7826e99e6 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -312,7 +312,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: "Ellipses cannot accompany other parameter types in function type signature", codes.SYNTAX ) TYPE_SIGNATURE_TOO_MANY_ARGS: Final = ErrorMessage( - "Type signature has too many arguments", codes.SYNTAX + "Type signature has too many parameter", codes.SYNTAX ) TYPE_SIGNATURE_TOO_FEW_ARGS: Final = ErrorMessage( "Type signature has too few arguments", codes.SYNTAX From 48c627cb9d917a5a97bda26e78f3843689b1b5b0 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:03:03 +0900 Subject: [PATCH 12/30] Update check-fastparse.test --- test-data/unit/check-fastparse.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-fastparse.test b/test-data/unit/check-fastparse.test index f1c0716e9fb8b..a08ba6d2581e1 100644 --- a/test-data/unit/check-fastparse.test +++ b/test-data/unit/check-fastparse.test @@ -178,7 +178,7 @@ def f(*, [out] [case testFasterParseTooManyArgumentsAnnotation] -def f(): # E: Type signature has too many arguments +def f(): # E: Type signature has too many parameters # type: (int) -> None pass @@ -218,7 +218,7 @@ x @= 1 def f(x): # E: Type signature has too few arguments # type: () -> None pass -def g(): # E: Type signature has too many arguments +def g(): # E: Type signature has too many parameters # type: (int) -> None pass From f53a296558002f8728d781d2e89eba7b4c1121a0 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:04:21 +0900 Subject: [PATCH 13/30] Update parse-errors.test --- test-data/unit/parse-errors.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/parse-errors.test b/test-data/unit/parse-errors.test index 99baf519e31cc..839ac8b179347 100644 --- a/test-data/unit/parse-errors.test +++ b/test-data/unit/parse-errors.test @@ -248,7 +248,7 @@ file:1: error: Function has duplicate type signatures def f(x, y): # type: (X, Y, Z) -> z pass [out] -file:1: error: Type signature has too many arguments +file:1: error: Type signature has too many parameters [case testTooFewTypes] def f(x, y): # type: (X) -> z From 9d0ae677fdc20b5476cd43d82ca6ba1e4a25346d Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:05:18 +0900 Subject: [PATCH 14/30] Update semanal-errors.test --- test-data/unit/semanal-errors.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/semanal-errors.test b/test-data/unit/semanal-errors.test index b69d35ce030e7..380b25150b741 100644 --- a/test-data/unit/semanal-errors.test +++ b/test-data/unit/semanal-errors.test @@ -1158,7 +1158,7 @@ def f(): # type: (int) -> int def g(x): # type: () -> int pass [out] -main:2: error: Type signature has too many arguments +main:2: error: Type signature has too many parameters main:4: error: Type signature has too few arguments [case testStaticmethodAndNonMethod] From 5458f4d771ba764e9e960c1268a50594df37ccc0 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:06:24 +0900 Subject: [PATCH 15/30] Update check-errorcodes.test --- test-data/unit/check-errorcodes.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test index c5bcf74b30920..81048a60eb75c 100644 --- a/test-data/unit/check-errorcodes.test +++ b/test-data/unit/check-errorcodes.test @@ -38,7 +38,7 @@ main:1: error: Invalid syntax [syntax] main:1: error: Invalid syntax. Perhaps you forgot a comma? [syntax] [case testErrorCodeSyntaxError2] -def f(): # E: Type signature has too many arguments [syntax] +def f(): # E: Type signature has too many parameters [syntax] # type: (int) -> None 1 @@ -549,7 +549,7 @@ def f(x): # E: Type signature has too few arguments [syntax] # type: () -> None pass -def g(x): # E: Type signature has too many arguments [syntax] +def g(x): # E: Type signature has too many parameters [syntax] # type: (int, int) -> None pass From 5c8534b14be81ac49f39b45db01122a94733c18d Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:12:33 +0900 Subject: [PATCH 16/30] Update message_registry.py --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 6e8b7826e99e6..6fbfd5339586f 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -315,7 +315,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: "Type signature has too many parameter", codes.SYNTAX ) TYPE_SIGNATURE_TOO_FEW_ARGS: Final = ErrorMessage( - "Type signature has too few arguments", codes.SYNTAX + "Type signature has too few parameters", codes.SYNTAX ) ARG_CONSTRUCTOR_NAME_EXPECTED: Final = ErrorMessage("Expected arg constructor name", codes.SYNTAX) ARG_CONSTRUCTOR_TOO_MANY_ARGS: Final = ErrorMessage( From 8afa534827ef03759e01f3fd76c2281068aebad5 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:14:07 +0900 Subject: [PATCH 17/30] Update check-fastparse.test --- test-data/unit/check-fastparse.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-fastparse.test b/test-data/unit/check-fastparse.test index a08ba6d2581e1..4eef7a0e116cb 100644 --- a/test-data/unit/check-fastparse.test +++ b/test-data/unit/check-fastparse.test @@ -186,7 +186,7 @@ f() f(1) # E: Too many arguments for "f" [case testFasterParseTooFewArgumentsAnnotation] -def f(x, y): # E: Type signature has too few arguments +def f(x, y): # E: Type signature has too few parameters # type: (int) -> None x() y() @@ -215,7 +215,7 @@ x @ 1 x @= 1 [case testFastParserShowsMultipleErrors] -def f(x): # E: Type signature has too few arguments +def f(x): # E: Type signature has too few parameters # type: () -> None pass def g(): # E: Type signature has too many parameters From 1755885466f199b65ae37a6f342b62c84e69a55f Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:16:27 +0900 Subject: [PATCH 18/30] Update parse-errors.test --- test-data/unit/parse-errors.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/parse-errors.test b/test-data/unit/parse-errors.test index 839ac8b179347..1eb3fbf8cba74 100644 --- a/test-data/unit/parse-errors.test +++ b/test-data/unit/parse-errors.test @@ -254,7 +254,7 @@ file:1: error: Type signature has too many parameters def f(x, y): # type: (X) -> z pass [out] -file:1: error: Type signature has too few arguments +file:1: error: Type signature has too few parameters [case testCommentFunctionAnnotationVarArgMispatch-skip] # see mypy issue #1997 From 47764f4095e95d73c3cd7a141290da293dd06452 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:17:14 +0900 Subject: [PATCH 19/30] Update check-columns.test --- test-data/unit/check-columns.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/check-columns.test b/test-data/unit/check-columns.test index 8458f0ac27dcd..7509fb2d12d9c 100644 --- a/test-data/unit/check-columns.test +++ b/test-data/unit/check-columns.test @@ -298,7 +298,7 @@ x = cast(int, y) # E:5: Redundant cast to "int" [case testColumnTypeSignatureHasTooFewArguments] if int(): - def f(x, y): # E:5: Type signature has too few arguments + def f(x, y): # E:5: Type signature has too few parameters # type: (int) -> None pass From 30dca1e855a24a3dfae6c37a63292560b474ddcd Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:18:30 +0900 Subject: [PATCH 20/30] Update fine-grained.test --- test-data/unit/fine-grained.test | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test-data/unit/fine-grained.test b/test-data/unit/fine-grained.test index 41fb0ed18ba88..bb9ace3e26702 100644 --- a/test-data/unit/fine-grained.test +++ b/test-data/unit/fine-grained.test @@ -9124,15 +9124,15 @@ x = '' x = 1 [out] -c.py:1: error: Type signature has too few arguments -a.py:1: error: Type signature has too few arguments -a.py:5: error: Type signature has too few arguments -a.py:11: error: Type signature has too few arguments -== -c.py:1: error: Type signature has too few arguments -a.py:1: error: Type signature has too few arguments -a.py:5: error: Type signature has too few arguments -a.py:11: error: Type signature has too few arguments +c.py:1: error: Type signature has too few parameters +a.py:1: error: Type signature has too few parameters +a.py:5: error: Type signature has too few parameters +a.py:11: error: Type signature has too few parameters +== +c.py:1: error: Type signature has too few parameters +a.py:1: error: Type signature has too few parameters +a.py:5: error: Type signature has too few parameters +a.py:11: error: Type signature has too few parameters [case testErrorReportingNewAnalyzer] # flags: --disallow-any-generics From 6b9bde72fe8a51f119cf22a99f147724265d14c5 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:19:24 +0900 Subject: [PATCH 21/30] Update semanal-errors.test --- test-data/unit/semanal-errors.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/semanal-errors.test b/test-data/unit/semanal-errors.test index 380b25150b741..40db0537c413e 100644 --- a/test-data/unit/semanal-errors.test +++ b/test-data/unit/semanal-errors.test @@ -1159,7 +1159,7 @@ def g(x): # type: () -> int pass [out] main:2: error: Type signature has too many parameters -main:4: error: Type signature has too few arguments +main:4: error: Type signature has too few parameters [case testStaticmethodAndNonMethod] import typing From 90e69549055793e81527083f7c879127dda9b628 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:20:26 +0900 Subject: [PATCH 22/30] Update check-functions.test --- test-data/unit/check-functions.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-functions.test b/test-data/unit/check-functions.test index e34ad2b0d4eb3..8ce971580714e 100644 --- a/test-data/unit/check-functions.test +++ b/test-data/unit/check-functions.test @@ -778,7 +778,7 @@ main:8: error: Argument 1 to "g" has incompatible type "A"; expected "int" class A: def f(self): # type: () -> None - def g(x): # E: Type signature has too few arguments + def g(x): # E: Type signature has too few parameters # type: () -> None pass @@ -802,7 +802,7 @@ class A: class B: def g(self): # type: () -> None - def h(x): # E: Type signature has too few arguments + def h(x): # E: Type signature has too few parameters # type: () -> None pass From 4566bd1bf06d00e1d5fc10719229dbc2ec549ae6 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:21:16 +0900 Subject: [PATCH 23/30] Update check-errorcodes.test --- test-data/unit/check-errorcodes.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test index 81048a60eb75c..26831a091f537 100644 --- a/test-data/unit/check-errorcodes.test +++ b/test-data/unit/check-errorcodes.test @@ -545,7 +545,7 @@ from typing import cast x = cast(int, int()) # E: Redundant cast to "int" [redundant-cast] [case testErrorCodeInvalidCommentSignature] -def f(x): # E: Type signature has too few arguments [syntax] +def f(x): # E: Type signature has too few parameters [syntax] # type: () -> None pass From b9ab2a7bb7139b2c9cf9937717e31a22f12fce56 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:23:08 +0900 Subject: [PATCH 24/30] Update message_registry.py --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 6fbfd5339586f..47bbbb732d87f 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -126,7 +126,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: RETURN_TYPE_EXPECTED: Final = ErrorMessage( "Function is missing a return type annotation", codes.NO_UNTYPED_DEF ) -ARGUMENT_TYPE_EXPECTED: Final = ErrorMessage( +PARAMETER_TYPE_EXPECTED: Final = ErrorMessage( "Function is missing a type annotation for one or more parameters", codes.NO_UNTYPED_DEF ) KEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE: Final = ErrorMessage( From 605c8b93781f39ec564614a72dc4b898d5e12a55 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:25:11 +0900 Subject: [PATCH 25/30] Update message_registry.py --- mypy/message_registry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 47bbbb732d87f..5053414069a61 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -308,13 +308,13 @@ def with_additional_msg(self, info: str) -> ErrorMessage: TYPE_COMMENT_SYNTAX_ERROR_VALUE: Final = ErrorMessage( 'Syntax error in type comment "{}"', codes.SYNTAX ) -ELLIPSIS_WITH_OTHER_TYPEARGS: Final = ErrorMessage( +ELLIPSIS_WITH_OTHER_TYPEPARAMS: Final = ErrorMessage( "Ellipses cannot accompany other parameter types in function type signature", codes.SYNTAX ) -TYPE_SIGNATURE_TOO_MANY_ARGS: Final = ErrorMessage( +TYPE_SIGNATURE_TOO_MANY_PARAMS: Final = ErrorMessage( "Type signature has too many parameter", codes.SYNTAX ) -TYPE_SIGNATURE_TOO_FEW_ARGS: Final = ErrorMessage( +TYPE_SIGNATURE_TOO_FEW_PARAMS: Final = ErrorMessage( "Type signature has too few parameters", codes.SYNTAX ) ARG_CONSTRUCTOR_NAME_EXPECTED: Final = ErrorMessage("Expected arg constructor name", codes.SYNTAX) From 2d825fc1ca2f3c121b8dc8ea213e6b04059c529b Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:26:09 +0900 Subject: [PATCH 26/30] Update fastparse.py --- mypy/fastparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index a8ed5eb038f51..e610cc9089088 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -1001,7 +1001,7 @@ def do_func_def( if any(arg_types) or return_type: if len(arg_types) != 1 and any(isinstance(t, EllipsisType) for t in arg_types): self.fail( - message_registry.ELLIPSIS_WITH_OTHER_TYPEARGS, + message_registry.ELLIPSIS_WITH_OTHER_TYPEPARAMS, lineno, n.col_offset, blocker=False, From 14ac318d38456b68fb35add577ea4e74674337d6 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:27:18 +0900 Subject: [PATCH 27/30] Update fastparse.py --- mypy/fastparse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index e610cc9089088..8ef905a567d14 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -1008,14 +1008,14 @@ def do_func_def( ) elif len(arg_types) > len(arg_kinds): self.fail( - message_registry.TYPE_SIGNATURE_TOO_MANY_ARGS, + message_registry.TYPE_SIGNATURE_TOO_MANY_PARAMS, lineno, n.col_offset, blocker=False, ) elif len(arg_types) < len(arg_kinds): self.fail( - message_registry.TYPE_SIGNATURE_TOO_FEW_ARGS, + message_registry.TYPE_SIGNATURE_TOO_FEW_PARAMS, lineno, n.col_offset, blocker=False, From 24f8fba4e5fd0d42e594e234b275f019fedb9662 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:41:57 +0900 Subject: [PATCH 28/30] Update checker.py --- mypy/checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/checker.py b/mypy/checker.py index d371f40ccaaeb..060be2c39b1f0 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -1792,7 +1792,7 @@ def is_unannotated_any(t: Type) -> bool: if is_unannotated_any(self.get_coroutine_return_type(ret_type)): self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef) if any(is_unannotated_any(t) for t in fdef.type.arg_types): - self.fail(message_registry.ARGUMENT_TYPE_EXPECTED, fdef) + self.fail(message_registry.PARAM_TYPE_EXPECTED, fdef) def check___new___signature(self, fdef: FuncDef, typ: CallableType) -> None: self_type = fill_typevars_with_any(fdef.info) From cb7277ae62bdb81d6c3ee129cab18e4ff81a67ff Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:43:31 +0900 Subject: [PATCH 29/30] Update message_registry.py --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index 5053414069a61..bbc0df1255dd5 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -126,7 +126,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: RETURN_TYPE_EXPECTED: Final = ErrorMessage( "Function is missing a return type annotation", codes.NO_UNTYPED_DEF ) -PARAMETER_TYPE_EXPECTED: Final = ErrorMessage( +PARAM_TYPE_EXPECTED: Final = ErrorMessage( "Function is missing a type annotation for one or more parameters", codes.NO_UNTYPED_DEF ) KEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE: Final = ErrorMessage( From 6116842e5f3d4f21a9850f8953509236e2e992a2 Mon Sep 17 00:00:00 2001 From: "Kai (Kazuya Ito)" Date: Mon, 2 Feb 2026 02:58:29 +0900 Subject: [PATCH 30/30] Update message_registry.py --- mypy/message_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/message_registry.py b/mypy/message_registry.py index bbc0df1255dd5..61a0764bd4833 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -312,7 +312,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: "Ellipses cannot accompany other parameter types in function type signature", codes.SYNTAX ) TYPE_SIGNATURE_TOO_MANY_PARAMS: Final = ErrorMessage( - "Type signature has too many parameter", codes.SYNTAX + "Type signature has too many parameters", codes.SYNTAX ) TYPE_SIGNATURE_TOO_FEW_PARAMS: Final = ErrorMessage( "Type signature has too few parameters", codes.SYNTAX