@dataclass class ScriptArguments: blabla = field() parser = HfArgumentParser(ScriptArguments) script_args = parser.parse_args_into_dataclasses()[0]
from argparse import ArgumentParser from enum import Enum from pathlib import Path from typing import Any, Iterable, List, NewType, Optional, Tuple, Union DataClass = NewType("DataClass", Any) DataClassType = NewType("DataClassType", Any) class HfArgumentParser(ArgumentParser):