Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester authored Sep 15, 2023
1 parent 099b7d9 commit e6d4b5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions argparse_dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def parse_known_args(
return options_class(**kwargs), others


def field_to_argument_args(field: Field[Any]) -> Tuple[List[str], Dict[str, Any]]:
def extract_argparse_kwargs(field: Field[Any]) -> Tuple[List[str], Dict[str, Any]]:
"""Extract kwargs of ArgumentParser.add_argument from a dataclass field.
Returns pair of (args, kwargs) to be passed to ArgumentParser.add_argument.
Expand Down Expand Up @@ -427,7 +427,7 @@ def add_dataclass_options(
raise TypeError("cls must be a dataclass")

for field in fields(options_class):
args, kwargs = field_to_argument_args(field)
args, kwargs = extract_argparse_kwargs(field)

if "group" in field.metadata:
_handle_argument_group(parser, field, args, kwargs)
Expand Down

0 comments on commit e6d4b5a

Please sign in to comment.