mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-27 21:32:12 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user