From e6d4b5a2c9d78a4192da1a7b376afeb71804a45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Fri, 15 Sep 2023 09:43:25 +0200 Subject: [PATCH] Rename function --- argparse_dataclass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/argparse_dataclass.py b/argparse_dataclass.py index c160f8b..bc9b314 100644 --- a/argparse_dataclass.py +++ b/argparse_dataclass.py @@ -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. @@ -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)