Skip to content

Commit

Permalink
argparse: simplify parse_args overloads (#9798)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Feb 22, 2023
1 parent 75f47d0 commit 76bfe8b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,12 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
add_help: bool = True,
allow_abbrev: bool = True,
) -> None: ...
# The type-ignores in these overloads should be temporary. See:
# https://github.com/python/typeshed/pull/2643#issuecomment-442280277
# Ignore errors about overlapping overloads
@overload
def parse_args(self, args: Sequence[str] | None = None) -> Namespace: ...
@overload
def parse_args(self, args: Sequence[str] | None, namespace: None) -> Namespace: ... # type: ignore[misc]
def parse_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... # type: ignore[misc]
@overload
def parse_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ...
@overload
def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore[misc]
@overload
def parse_args(self, *, namespace: _N) -> _N: ...
@overload
def add_subparsers(
Expand Down

0 comments on commit 76bfe8b

Please sign in to comment.