From d19e3689f160a98e295ce33c0bf4af9d2f396777 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Wed, 29 Dec 2021 08:45:09 +0000 Subject: [PATCH 1/2] Fixed `formal_arguments` docstring 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 14eefea7dd819..66fb06c8d9fc4 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -1247,7 +1247,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 corresponding to 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. From 381650ce6547dcbc5caf20cd2c3166167729653f Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Wed, 29 Dec 2021 11:05:18 +0000 Subject: [PATCH 2/2] Fix `formal_arguments` docstring to meet lint length --- mypy/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/types.py b/mypy/types.py index 66fb06c8d9fc4..d966e82a2591b 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -1247,7 +1247,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]: - """Return a list of 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.