Skip to content

Commit

Permalink
Add overloads for get_parser()
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Oct 14, 2022
1 parent 8634789 commit b98b758
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tyro/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@ def cli(
)


@overload
def get_parser(
f: Type[OutT],
*,
prog: Optional[str] = None,
description: Optional[str] = None,
default: Optional[OutT] = None,
) -> argparse.ArgumentParser:
...


@overload
def get_parser(
f: Callable[..., OutT],
*,
prog: Optional[str] = None,
description: Optional[str] = None,
default: Optional[OutT] = None,
) -> argparse.ArgumentParser:
...


def get_parser(
f: Union[Type[OutT], Callable[..., OutT]],
*,
Expand Down

0 comments on commit b98b758

Please sign in to comment.