mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-03 08:32:44 +08:00
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from _typeshed import SupportsRead
|
||||
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
@@ -34,14 +33,8 @@ def dump(
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any,
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
_LoadsString = Union[str, bytes]
|
||||
else:
|
||||
_LoadsString = str
|
||||
|
||||
def loads(
|
||||
s: _LoadsString,
|
||||
s: Union[str, bytes],
|
||||
*,
|
||||
cls: Optional[Type[JSONDecoder]] = ...,
|
||||
object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ...,
|
||||
@@ -52,7 +45,7 @@ def loads(
|
||||
**kwds: Any,
|
||||
) -> Any: ...
|
||||
def load(
|
||||
fp: SupportsRead[_LoadsString],
|
||||
fp: SupportsRead[Union[str, bytes]],
|
||||
*,
|
||||
cls: Optional[Type[JSONDecoder]] = ...,
|
||||
object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ...,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple
|
||||
|
||||
class JSONDecodeError(ValueError):
|
||||
@@ -16,27 +15,15 @@ class JSONDecoder:
|
||||
parse_constant: Callable[[str], Any] = ...
|
||||
strict: bool
|
||||
object_pairs_hook: Callable[[List[Tuple[str, Any]]], Any]
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...,
|
||||
) -> None: ...
|
||||
def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented
|
||||
def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ...
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Iterator, Optional, Tuple
|
||||
|
||||
class JSONEncoder:
|
||||
@@ -11,32 +10,18 @@ class JSONEncoder:
|
||||
allow_nan: bool
|
||||
sort_keys: bool
|
||||
indent: int
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[..., Any]] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[..., Any]] = ...,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[..., Any]] = ...,
|
||||
) -> None: ...
|
||||
def default(self, o: Any) -> Any: ...
|
||||
def encode(self, o: Any) -> str: ...
|
||||
def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ...
|
||||
|
||||
Reference in New Issue
Block a user