Skip to content

Commit

Permalink
Fix mypy issues in configure_argparse.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fleonce committed Nov 19, 2024
1 parent f47112b commit a334489
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions with_argparse/configure_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def _register_post_parse_type_conversion(self, key: str, func: Callable[[Any], A
def call(self, args: Sequence[Any], kwargs: Mapping[str, Any]):
info = inspect.getfullargspec(self.func)
callable_args = info.args or []
callable_kwonly = info.kwonlyargs or dict()
callable_defaults = info.defaults or []
callable_kwonly = info.kwonlyargs or []
callable_defaults = info.defaults or tuple()

# the first N arguments have no default value
# ... num positional args - num positional args w/ defaults
Expand Down Expand Up @@ -140,7 +140,7 @@ def call(self, args: Sequence[Any], kwargs: Mapping[str, Any]):

self._setup_argument(arg, arg_type, arg_default, arg_required)
setup_arguments += 1
for i, arg in enumerate(info.kwonlyargs or []):
for i, arg in enumerate(callable_kwonly):
argument_names.append(arg)
if arg in self.ignore_arg_keys:
continue
Expand Down

0 comments on commit a334489

Please sign in to comment.