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

@@ -10,52 +10,52 @@ __all__ = ["dump", "dumps", "load", "loads", "JSONDecoder", "JSONDecodeError", "
def dumps(
obj: Any,
*,
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
cls: type[JSONEncoder] | None = ...,
indent: None | int | str = ...,
separators: tuple[str, str] | None = ...,
default: Callable[[Any], Any] | None = ...,
sort_keys: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = True,
cls: type[JSONEncoder] | None = None,
indent: None | int | str = None,
separators: tuple[str, str] | None = None,
default: Callable[[Any], Any] | None = None,
sort_keys: bool = False,
**kwds: Any,
) -> str: ...
def dump(
obj: Any,
fp: SupportsWrite[str],
*,
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
cls: type[JSONEncoder] | None = ...,
indent: None | int | str = ...,
separators: tuple[str, str] | None = ...,
default: Callable[[Any], Any] | None = ...,
sort_keys: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = True,
cls: type[JSONEncoder] | None = None,
indent: None | int | str = None,
separators: tuple[str, str] | None = None,
default: Callable[[Any], Any] | None = None,
sort_keys: bool = False,
**kwds: Any,
) -> None: ...
def loads(
s: str | bytes | bytearray,
*,
cls: type[JSONDecoder] | None = ...,
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
parse_float: Callable[[str], Any] | None = ...,
parse_int: Callable[[str], Any] | None = ...,
parse_constant: Callable[[str], Any] | None = ...,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
**kwds: Any,
) -> Any: ...
def load(
fp: SupportsRead[str | bytes],
*,
cls: type[JSONDecoder] | None = ...,
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
parse_float: Callable[[str], Any] | None = ...,
parse_int: Callable[[str], Any] | None = ...,
parse_constant: Callable[[str], Any] | None = ...,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
**kwds: Any,
) -> Any: ...
def detect_encoding(b: bytes | bytearray) -> str: ... # undocumented

View File

@@ -21,12 +21,12 @@ class JSONDecoder:
def __init__(
self,
*,
object_hook: Callable[[dict[str, Any]], Any] | None = ...,
parse_float: Callable[[str], Any] | None = ...,
parse_int: Callable[[str], Any] | None = ...,
parse_constant: Callable[[str], Any] | None = ...,
strict: bool = ...,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = ...,
object_hook: Callable[[dict[str, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
strict: bool = True,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None,
) -> None: ...
def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented
def raw_decode(self, s: str, idx: int = ...) -> tuple[Any, int]: ...
def raw_decode(self, s: str, idx: int = 0) -> tuple[Any, int]: ...

View File

@@ -24,15 +24,15 @@ class JSONEncoder:
def __init__(
self,
*,
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
sort_keys: bool = ...,
indent: int | str | None = ...,
separators: tuple[str, str] | None = ...,
default: Callable[..., Any] | None = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = True,
sort_keys: bool = False,
indent: int | str | None = None,
separators: tuple[str, str] | None = None,
default: Callable[..., Any] | None = None,
) -> None: ...
def default(self, o: Any) -> Any: ...
def encode(self, o: Any) -> str: ...
def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ...
def iterencode(self, o: Any, _one_shot: bool = False) -> Iterator[str]: ...