@@ -747,8 +747,8 @@ def names_approx_match(a: str, b: str) -> bool:
747747 if stub_arg .variable .name == "_self" :
748748 return
749749 yield (
750- f'stub argument "{ stub_arg .variable .name } " '
751- f'differs from runtime argument "{ runtime_arg .name } "'
750+ f'stub parameter "{ stub_arg .variable .name } " '
751+ f'differs from runtime parameter "{ runtime_arg .name } "'
752752 )
753753
754754
@@ -759,8 +759,8 @@ def _verify_arg_default_value(
759759 if runtime_arg .default is not inspect .Parameter .empty :
760760 if stub_arg .kind .is_required ():
761761 yield (
762- f'runtime argument "{ runtime_arg .name } " '
763- "has a default value but stub argument does not"
762+ f'runtime parameter "{ runtime_arg .name } " '
763+ "has a default value but stub parameter does not"
764764 )
765765 else :
766766 runtime_type = get_mypy_type_of_runtime_value (runtime_arg .default )
@@ -781,9 +781,9 @@ def _verify_arg_default_value(
781781 and not is_subtype_helper (runtime_type , stub_type )
782782 ):
783783 yield (
784- f'runtime argument "{ runtime_arg .name } " '
784+ f'runtime parameter "{ runtime_arg .name } " '
785785 f"has a default value of type { runtime_type } , "
786- f"which is incompatible with stub argument type { stub_type } "
786+ f"which is incompatible with stub parameter type { stub_type } "
787787 )
788788 if stub_arg .initializer is not None :
789789 stub_default = evaluate_expression (stub_arg .initializer )
@@ -807,15 +807,15 @@ def _verify_arg_default_value(
807807 defaults_match = False
808808 if not defaults_match :
809809 yield (
810- f'runtime argument "{ runtime_arg .name } " '
810+ f'runtime parameter "{ runtime_arg .name } " '
811811 f"has a default value of { runtime_arg .default !r} , "
812- f"which is different from stub argument default { stub_default !r} "
812+ f"which is different from stub parameter default { stub_default !r} "
813813 )
814814 else :
815815 if stub_arg .kind .is_optional ():
816816 yield (
817- f'stub argument "{ stub_arg .variable .name } " has a default value '
818- f"but runtime argument does not"
817+ f'stub parameter "{ stub_arg .variable .name } " has a default value '
818+ f"but runtime parameter does not"
819819 )
820820
821821
@@ -1013,7 +1013,7 @@ def _verify_signature(
10131013 and not is_dunder (function_name , exclude_special = True ) # noisy for dunder methods
10141014 ):
10151015 yield (
1016- f'stub argument "{ stub_arg .variable .name } " should be positional-only '
1016+ f'stub parameter "{ stub_arg .variable .name } " should be positional-only '
10171017 f'(add "/", e.g. "{ runtime_arg .name } , /")'
10181018 )
10191019 if (
@@ -1025,7 +1025,7 @@ def _verify_signature(
10251025 and not is_dunder (function_name , exclude_special = True ) # noisy for dunder methods
10261026 ):
10271027 yield (
1028- f'stub argument "{ stub_arg .variable .name } " should be positional or keyword '
1028+ f'stub parameter "{ stub_arg .variable .name } " should be positional or keyword '
10291029 '(remove "/")'
10301030 )
10311031
@@ -1040,28 +1040,28 @@ def _verify_signature(
10401040 # If the variable is in runtime.kwonly, it's just mislabelled as not a
10411041 # keyword-only argument
10421042 if stub_arg .variable .name not in runtime .kwonly :
1043- msg = f'runtime does not have argument "{ stub_arg .variable .name } "'
1043+ msg = f'runtime does not have parameter "{ stub_arg .variable .name } "'
10441044 if runtime .varkw is not None :
10451045 msg += ". Maybe you forgot to make it keyword-only in the stub?"
10461046 yield msg
10471047 else :
1048- yield f'stub argument "{ stub_arg .variable .name } " is not keyword-only'
1048+ yield f'stub parameter "{ stub_arg .variable .name } " is not keyword-only'
10491049 if stub .varpos is not None :
1050- yield f'runtime does not have *args argument "{ stub .varpos .variable .name } "'
1050+ yield f'runtime does not have *args parameter "{ stub .varpos .variable .name } "'
10511051 elif len (stub .pos ) < len (runtime .pos ):
10521052 for runtime_arg in runtime .pos [len (stub .pos ) :]:
10531053 if runtime_arg .name not in stub .kwonly :
10541054 if not _is_private_parameter (runtime_arg ):
1055- yield f'stub does not have argument "{ runtime_arg .name } "'
1055+ yield f'stub does not have parameter "{ runtime_arg .name } "'
10561056 else :
1057- yield f'runtime argument "{ runtime_arg .name } " is not keyword-only'
1057+ yield f'runtime parameter "{ runtime_arg .name } " is not keyword-only'
10581058
10591059 # Checks involving *args
10601060 if len (stub .pos ) <= len (runtime .pos ) or runtime .varpos is None :
10611061 if stub .varpos is None and runtime .varpos is not None :
1062- yield f'stub does not have *args argument "{ runtime .varpos .name } "'
1062+ yield f'stub does not have *args parameter "{ runtime .varpos .name } "'
10631063 if stub .varpos is not None and runtime .varpos is None :
1064- yield f'runtime does not have *args argument "{ stub .varpos .variable .name } "'
1064+ yield f'runtime does not have *args parameter "{ stub .varpos .variable .name } "'
10651065
10661066 # Check keyword-only args
10671067 for arg in sorted (set (stub .kwonly ) & set (runtime .kwonly )):
@@ -1080,20 +1080,20 @@ def _verify_signature(
10801080 if arg in {runtime_arg .name for runtime_arg in runtime .pos }:
10811081 # Don't report this if we've reported it before
10821082 if arg not in {runtime_arg .name for runtime_arg in runtime .pos [len (stub .pos ) :]}:
1083- yield f'runtime argument "{ arg } " is not keyword-only'
1083+ yield f'runtime parameter "{ arg } " is not keyword-only'
10841084 else :
1085- yield f'runtime does not have argument "{ arg } "'
1085+ yield f'runtime does not have parameter "{ arg } "'
10861086 for arg in sorted (set (runtime .kwonly ) - set (stub .kwonly )):
10871087 if arg in {stub_arg .variable .name for stub_arg in stub .pos }:
10881088 # Don't report this if we've reported it before
10891089 if not (
10901090 runtime .varpos is None
10911091 and arg in {stub_arg .variable .name for stub_arg in stub .pos [len (runtime .pos ) :]}
10921092 ):
1093- yield f'stub argument "{ arg } " is not keyword-only'
1093+ yield f'stub parameter "{ arg } " is not keyword-only'
10941094 else :
10951095 if not _is_private_parameter (runtime .kwonly [arg ]):
1096- yield f'stub does not have argument "{ arg } "'
1096+ yield f'stub does not have parameter "{ arg } "'
10971097
10981098 # Checks involving **kwargs
10991099 if stub .varkw is None and runtime .varkw is not None :
@@ -1103,9 +1103,9 @@ def _verify_signature(
11031103 stub_pos_names = {stub_arg .variable .name for stub_arg in stub .pos }
11041104 # Ideally we'd do a strict subset check, but in practice the errors from that aren't useful
11051105 if not set (runtime .kwonly ).issubset (set (stub .kwonly ) | stub_pos_names ):
1106- yield f'stub does not have **kwargs argument "{ runtime .varkw .name } "'
1106+ yield f'stub does not have **kwargs parameter "{ runtime .varkw .name } "'
11071107 if stub .varkw is not None and runtime .varkw is None :
1108- yield f'runtime does not have **kwargs argument "{ stub .varkw .variable .name } "'
1108+ yield f'runtime does not have **kwargs parameter "{ stub .varkw .variable .name } "'
11091109
11101110
11111111def _is_private_parameter (arg : inspect .Parameter ) -> bool :
@@ -1425,7 +1425,7 @@ def apply_decorator_to_funcitem(
14251425 if decorator .fullname == "builtins.classmethod" :
14261426 if func .arguments [0 ].variable .name not in ("cls" , "mcs" , "metacls" ):
14271427 raise StubtestFailure (
1428- f"unexpected class argument name { func .arguments [0 ].variable .name !r} "
1428+ f"unexpected class parameter name { func .arguments [0 ].variable .name !r} "
14291429 f"in { dec .fullname } "
14301430 )
14311431 # FuncItem is written so that copy.copy() actually works, even when compiled
0 commit comments