From 25b212990faed11993d49e822d50a0a88e10c959 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Sun, 9 Jan 2022 17:18:29 +0000 Subject: [PATCH] Fix `CallableType.formal_arguments` docstring (#11861) PR #11543 changed the `formal_arguments` method to return a list of formal arguments instead of yielding them. However the docstring was not updated at the time to reflect this. --- mypy/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/types.py b/mypy/types.py index 39c0d8f64011..128b9bf016d7 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -1273,7 +1273,7 @@ def max_possible_positional_args(self) -> int: return sum([kind.is_positional() for kind in self.arg_kinds]) def formal_arguments(self, include_star_args: bool = False) -> List[FormalArgument]: - """Yields the formal arguments corresponding to this callable, ignoring *arg and **kwargs. + """Return a list of the formal arguments of this callable, ignoring *arg and **kwargs. To handle *args and **kwargs, use the 'callable.var_args' and 'callable.kw_args' fields, if they are not None.