mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Added JSONEncoder and JSONDecoder to stdlib/2.7/json.pyi (#332)
This commit is contained in:
committed by
Guido van Rossum
parent
df1a655858
commit
a393897c9a
@@ -52,3 +52,47 @@ def load(fp: IO[str],
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
|
||||
class JSONDecoder(object):
|
||||
def __init__(self,
|
||||
encoding: Union[Text, bytes] = ...,
|
||||
object_hook: Callable[..., Any] = ...,
|
||||
parse_float: Callable[[str], float] = ...,
|
||||
parse_int: Callable[[str], int] = ...,
|
||||
parse_constant: Callable[[str], Any] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Callable[..., Any] = ...) -> None: ...
|
||||
|
||||
def decode(self, s: Union[Text, bytes], _w = ...) -> Any: ...
|
||||
|
||||
def raw_decode(self,
|
||||
s: Union[Text, bytes],
|
||||
idx: int = ...) -> Tuple[Any, Any]: ...
|
||||
|
||||
class JSONEncoder(object):
|
||||
item_separator = ... # type: str
|
||||
key_separator = ... # type: str
|
||||
skipkeys = ... # type: bool
|
||||
ensure_ascii = ... # type: bool
|
||||
check_circular = ... # type: bool
|
||||
allow_nan = ... # type: bool
|
||||
sort_keys = ... # type: bool
|
||||
indent = ... # type: int
|
||||
|
||||
def __init__(self,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: int = ...,
|
||||
separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ...,
|
||||
encoding: Union[Text, bytes] = ...,
|
||||
default: Callable[..., Any] = ...) -> None: ...
|
||||
|
||||
def default(self, o: Any) -> Any: ...
|
||||
|
||||
def encode(self, o: Any) -> str: ...
|
||||
|
||||
def iterencode(self, o: Any, _one_shot: bool = ...) -> str: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user