Add missing defaults to third-party stubs (#14617)

This commit is contained in:
Jelle Zijlstra
2025-08-21 13:36:29 -07:00
committed by GitHub
parent 82926783a4
commit 573b57d8da
54 changed files with 383 additions and 376 deletions
+108 -108
View File
@@ -15,156 +15,156 @@ _T = TypeVar("_T")
@overload
def dumps(
obj: Any,
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = False,
*,
cls: type[JSONEncoder],
indent: str | int | None = ...,
separators: tuple[str, str] | None = ...,
encoding: str | None = ...,
default: Callable[[Any], Any] | None = ...,
use_decimal: bool = ...,
namedtuple_as_object: bool = ...,
tuple_as_array: bool = ...,
bigint_as_string: bool = ...,
sort_keys: bool = ...,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = ...,
for_json: bool = ...,
ignore_nan: bool = ...,
int_as_string_bitcount: int | None = ...,
iterable_as_array: bool = ...,
indent: str | int | None = None,
separators: tuple[str, str] | None = None,
encoding: str | None = "utf-8",
default: Callable[[Any], Any] | None = None,
use_decimal: bool = True,
namedtuple_as_object: bool = True,
tuple_as_array: bool = True,
bigint_as_string: bool = False,
sort_keys: bool = False,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = None,
for_json: bool = False,
ignore_nan: bool = False,
int_as_string_bitcount: int | None = None,
iterable_as_array: bool = False,
**kw: Any,
) -> str: ...
@overload
def dumps(
obj: Any,
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
cls: type[JSONEncoder] | None = ...,
indent: str | int | None = ...,
separators: tuple[str, str] | None = ...,
encoding: str | None = ...,
default: Callable[[Any], Any] | None = ...,
use_decimal: bool = ...,
namedtuple_as_object: bool = ...,
tuple_as_array: bool = ...,
bigint_as_string: bool = ...,
sort_keys: bool = ...,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = ...,
for_json: bool = ...,
ignore_nan: bool = ...,
int_as_string_bitcount: int | None = ...,
iterable_as_array: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = False,
cls: type[JSONEncoder] | None = None,
indent: str | int | None = None,
separators: tuple[str, str] | None = None,
encoding: str | None = "utf-8",
default: Callable[[Any], Any] | None = None,
use_decimal: bool = True,
namedtuple_as_object: bool = True,
tuple_as_array: bool = True,
bigint_as_string: bool = False,
sort_keys: bool = False,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = None,
for_json: bool = False,
ignore_nan: bool = False,
int_as_string_bitcount: int | None = None,
iterable_as_array: bool = False,
) -> str: ...
@overload
def dump(
obj: Any,
fp: IO[str],
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = False,
*,
cls: type[JSONEncoder],
indent: str | int | None = ...,
separators: tuple[str, str] | None = ...,
encoding: str | None = ...,
default: Callable[[Any], Any] | None = ...,
use_decimal: bool = ...,
namedtuple_as_object: bool = ...,
tuple_as_array: bool = ...,
bigint_as_string: bool = ...,
sort_keys: bool = ...,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = ...,
for_json: bool = ...,
ignore_nan: bool = ...,
int_as_string_bitcount: int | None = ...,
iterable_as_array: bool = ...,
indent: str | int | None = None,
separators: tuple[str, str] | None = None,
encoding: str | None = "utf-8",
default: Callable[[Any], Any] | None = None,
use_decimal: bool = True,
namedtuple_as_object: bool = True,
tuple_as_array: bool = True,
bigint_as_string: bool = False,
sort_keys: bool = False,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = None,
for_json: bool = False,
ignore_nan: bool = False,
int_as_string_bitcount: int | None = None,
iterable_as_array: bool = False,
**kw: Any,
) -> None: ...
@overload
def dump(
obj: Any,
fp: IO[str],
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
cls: type[JSONEncoder] | None = ...,
indent: str | int | None = ...,
separators: tuple[str, str] | None = ...,
encoding: str | None = ...,
default: Callable[[Any], Any] | None = ...,
use_decimal: bool = ...,
namedtuple_as_object: bool = ...,
tuple_as_array: bool = ...,
bigint_as_string: bool = ...,
sort_keys: bool = ...,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = ...,
for_json: bool = ...,
ignore_nan: bool = ...,
int_as_string_bitcount: int | None = ...,
iterable_as_array: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = False,
cls: type[JSONEncoder] | None = None,
indent: str | int | None = None,
separators: tuple[str, str] | None = None,
encoding: str | None = "utf-8",
default: Callable[[Any], Any] | None = None,
use_decimal: bool = True,
namedtuple_as_object: bool = True,
tuple_as_array: bool = True,
bigint_as_string: bool = False,
sort_keys: bool = False,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = None,
for_json: bool = False,
ignore_nan: bool = False,
int_as_string_bitcount: int | None = None,
iterable_as_array: bool = False,
) -> None: ...
@overload
def loads(
s: _LoadsString,
encoding: str | None = ...,
encoding: str | None = None,
*,
cls: type[JSONDecoder],
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 = ...,
use_decimal: bool = ...,
allow_nan: bool = ...,
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,
use_decimal: bool = False,
allow_nan: bool = False,
**kw: Any,
) -> Any: ...
@overload
def loads(
s: _LoadsString,
encoding: str | None = ...,
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 = ...,
use_decimal: bool = ...,
allow_nan: bool = ...,
encoding: str | None = 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,
use_decimal: bool = False,
allow_nan: bool = False,
) -> Any: ...
@overload
def load(
fp: IO[str],
encoding: str | None = ...,
encoding: str | None = None,
*,
cls: type[JSONDecoder],
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 = ...,
use_decimal: bool = ...,
allow_nan: bool = ...,
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,
use_decimal: bool = False,
allow_nan: bool = False,
**kw: Any,
) -> Any: ...
@overload
def load(
fp: IO[str],
encoding: str | None = ...,
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 = ...,
use_decimal: bool = ...,
allow_nan: bool = ...,
encoding: str | None = 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,
use_decimal: bool = False,
allow_nan: bool = False,
) -> Any: ...
def simple_first(kv: tuple[_T, object]) -> tuple[bool, _T]: ...
+10 -10
View File
@@ -15,18 +15,18 @@ class JSONDecoder:
def __init__(
self,
encoding: str | 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 = ...,
strict: bool = ...,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
allow_nan: bool = ...,
encoding: str | 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,
strict: bool = True,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
allow_nan: bool = False,
) -> None: ...
def decode(self, s: str, _w: Callable[[str, int], Match[str]] = ..., _PY3: Literal[True] = ...) -> Any: ...
def decode(self, s: str, _w: Callable[[str, int], Match[str]] = ..., _PY3: Literal[True] = True) -> Any: ...
def raw_decode(
self, s: str, idx: int = ..., _w: Callable[[str, int], Match[str]] = ..., _PY3: Literal[True] = ...
self, s: str, idx: int = 0, _w: Callable[[str, int], Match[str]] = ..., _PY3: Literal[True] = True
) -> tuple[Any, int]: ...
__all__ = ["JSONDecoder"]
+19 -19
View File
@@ -31,24 +31,24 @@ class JSONEncoder:
def __init__(
self,
skipkeys: bool = ...,
ensure_ascii: bool = ...,
check_circular: bool = ...,
allow_nan: bool = ...,
sort_keys: bool = ...,
indent: str | int | None = ...,
separators: tuple[str, str] | None = ...,
encoding: str = ...,
default: Callable[[Any], Any] | None = ...,
use_decimal: bool = ...,
namedtuple_as_object: bool = ...,
tuple_as_array: bool = ...,
bigint_as_string: bool = ...,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = ...,
for_json: bool = ...,
ignore_nan: bool = ...,
int_as_string_bitcount: int | None = ...,
iterable_as_array: bool = ...,
skipkeys: bool = False,
ensure_ascii: bool = True,
check_circular: bool = True,
allow_nan: bool = False,
sort_keys: bool = False,
indent: str | int | None = None,
separators: tuple[str, str] | None = None,
encoding: str = "utf-8",
default: Callable[[Any], Any] | None = None,
use_decimal: bool = True,
namedtuple_as_object: bool = True,
tuple_as_array: bool = True,
bigint_as_string: bool = False,
item_sort_key: Callable[[Any], SupportsRichComparison] | None = None,
for_json: bool = False,
ignore_nan: bool = False,
int_as_string_bitcount: int | None = None,
iterable_as_array: bool = False,
) -> None: ...
def encode(self, o: Any) -> str: ...
def default(self, o: Any) -> NoReturn: ...
@@ -56,5 +56,5 @@ class JSONEncoder:
class JSONEncoderForHTML(JSONEncoder): ...
def encode_basestring(s: str | bytes, _PY3: Literal[True] = ..., _q: str = ...) -> str: ...
def encode_basestring(s: str | bytes, _PY3: Literal[True] = True, _q: str = '"') -> str: ...
def encode_basestring_ascii(s: str | bytes, /) -> str: ...