Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix namespace argument regression in argparse.parse_args #10387

Merged
merged 4 commits into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
) -> None: ...

@overload
def parse_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = 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
Expand Down Expand Up @@ -210,7 +210,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def format_usage(self) -> str: ...
def format_help(self) -> str: ...
@overload
def parse_known_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> tuple[Namespace, list[str]]: ... # type: ignore[misc]
def parse_known_args(self, args: Sequence[str] | None = None, namespace: None = None) -> tuple[Namespace, list[str]]: ... # type: ignore[misc]
@overload
def parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ...
@overload
Expand All @@ -219,13 +219,13 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ...
def error(self, message: str) -> NoReturn: ...
@overload
def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> Namespace: ... # type: ignore[misc]
def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... # type: ignore[misc]
@overload
def parse_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ...
@overload
def parse_intermixed_args(self, *, namespace: _N) -> _N: ...
@overload
def parse_known_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> tuple[Namespace, list[str]]: ... # type: ignore[misc]
def parse_known_intermixed_args(self, args: Sequence[str] | None = None, namespace: None = None) -> tuple[Namespace, list[str]]: ... # type: ignore[misc]
@overload
def parse_known_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ...
@overload
Expand Down