stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -43,10 +43,10 @@ class _ResultMixinBase(Generic[AnyStr]):
def geturl(self) -> AnyStr: ...
class _ResultMixinStr(_ResultMixinBase[str]):
def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ...
def encode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinBytes: ...
class _ResultMixinBytes(_ResultMixinBase[bytes]):
def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ...
def decode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinStr: ...
class _NetlocResultMixinBase(Generic[AnyStr]):
@property
@@ -115,40 +115,40 @@ class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ...
def parse_qs(
qs: AnyStr | None,
keep_blank_values: bool = ...,
strict_parsing: bool = ...,
encoding: str = ...,
errors: str = ...,
max_num_fields: int | None = ...,
separator: str = ...,
keep_blank_values: bool = False,
strict_parsing: bool = False,
encoding: str = "utf-8",
errors: str = "replace",
max_num_fields: int | None = None,
separator: str = "&",
) -> dict[AnyStr, list[AnyStr]]: ...
def parse_qsl(
qs: AnyStr | None,
keep_blank_values: bool = ...,
strict_parsing: bool = ...,
encoding: str = ...,
errors: str = ...,
max_num_fields: int | None = ...,
separator: str = ...,
keep_blank_values: bool = False,
strict_parsing: bool = False,
encoding: str = "utf-8",
errors: str = "replace",
max_num_fields: int | None = None,
separator: str = "&",
) -> list[tuple[AnyStr, AnyStr]]: ...
@overload
def quote(string: str, safe: str | Iterable[int] = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ...
@overload
def quote(string: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ...
def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ...
def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ...
@overload
def quote_plus(string: str, safe: str | Iterable[int] = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ...
@overload
def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ...
if sys.version_info >= (3, 9):
def unquote(string: str | bytes, encoding: str = ..., errors: str = ...) -> str: ...
def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ...
else:
def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ...
def unquote_to_bytes(string: str | bytes | bytearray) -> bytes: ...
def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ...
def unquote_plus(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ...
@overload
def urldefrag(url: str) -> DefragResult: ...
@overload
@@ -164,7 +164,7 @@ def urlencode(
errors: str | None = None,
quote_via: Callable[[AnyStr, _Q, str, str], str] = ...,
) -> str: ...
def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = ...) -> AnyStr: ...
def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> AnyStr: ...
@overload
def urlparse(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> ParseResult: ...
@overload