mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add more defaults to the stdlib (#9606)
Continuing work towards #8988. The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are: - Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine) - Defaults in non-py311 branches - Defaults for float parameters - Defaults for overloads
This commit is contained in:
@@ -148,23 +148,23 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
prog: str | None = ...,
|
||||
usage: str | None = ...,
|
||||
description: str | None = ...,
|
||||
epilog: str | None = ...,
|
||||
prog: str | None = None,
|
||||
usage: str | None = None,
|
||||
description: str | None = None,
|
||||
epilog: str | None = None,
|
||||
parents: Sequence[ArgumentParser] = ...,
|
||||
formatter_class: _FormatterClass = ...,
|
||||
prefix_chars: str = ...,
|
||||
fromfile_prefix_chars: str | None = ...,
|
||||
argument_default: Any = ...,
|
||||
conflict_handler: str = ...,
|
||||
add_help: bool = ...,
|
||||
allow_abbrev: bool = ...,
|
||||
prefix_chars: str = "-",
|
||||
fromfile_prefix_chars: str | None = None,
|
||||
argument_default: Any = None,
|
||||
conflict_handler: str = "error",
|
||||
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
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[str] | None = ...) -> Namespace: ...
|
||||
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]
|
||||
@overload
|
||||
@@ -378,10 +378,10 @@ class _StoreConstAction(Action):
|
||||
option_strings: Sequence[str],
|
||||
dest: str,
|
||||
const: Any,
|
||||
default: Any = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
default: Any = None,
|
||||
required: bool = False,
|
||||
help: str | None = None,
|
||||
metavar: str | tuple[str, ...] | None = None,
|
||||
) -> None: ...
|
||||
|
||||
# undocumented
|
||||
@@ -422,10 +422,10 @@ class _AppendConstAction(Action):
|
||||
option_strings: Sequence[str],
|
||||
dest: str,
|
||||
const: Any,
|
||||
default: Any = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
default: Any = None,
|
||||
required: bool = False,
|
||||
help: str | None = None,
|
||||
metavar: str | tuple[str, ...] | None = None,
|
||||
) -> None: ...
|
||||
|
||||
# undocumented
|
||||
|
||||
Reference in New Issue
Block a user