mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Expand stub for simplejson module to include decoders/encoders.
This commit is contained in:
10
stdlib/2.7/simplejson/__init__.pyi
Normal file
10
stdlib/2.7/simplejson/__init__.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Any, IO
|
||||
|
||||
def dumps(obj: Any) -> str: ...
|
||||
def dump(obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ...
|
||||
def loads(s: str, **kwds: Any) -> Any: ...
|
||||
def load(fp: IO[str]) -> Any: ...
|
||||
|
||||
from .scanner import JSONDecodeError
|
||||
from .decoder import JSONDecoder
|
||||
from .encoder import JSONEncoder, JSONEncoderForHTML
|
||||
6
stdlib/2.7/simplejson/decoder.pyi
Normal file
6
stdlib/2.7/simplejson/decoder.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from typing import Any, Match
|
||||
|
||||
class JSONDecoder(object):
|
||||
def __init__(self, **kwargs): ...
|
||||
def decode(self, s: str, _w: Match[str], _PY3: bool): ...
|
||||
def raw_decode(self, s: str, idx: int, _w: Match[str], _PY3: bool): ...
|
||||
9
stdlib/2.7/simplejson/encoder.pyi
Normal file
9
stdlib/2.7/simplejson/encoder.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import Any, IO
|
||||
|
||||
class JSONEncoder(object):
|
||||
def __init__(self, *args, **kwargs): ...
|
||||
def encode(self, o: Any): ...
|
||||
def default(self, o: Any): ...
|
||||
def iterencode(self, o: Any, _one_shot: bool): ...
|
||||
|
||||
class JSONEncoderForHTML(JSONEncoder): ...
|
||||
@@ -5,8 +5,3 @@ class JSONDecodeError(ValueError):
|
||||
def dump(self, obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ...
|
||||
def loads(self, s: str) -> Any: ...
|
||||
def load(self, fp: IO[str]) -> Any: ...
|
||||
|
||||
def dumps(obj: Any) -> str: ...
|
||||
def dump(obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ...
|
||||
def loads(s: str, **kwds: Any) -> Any: ...
|
||||
def load(fp: IO[str]) -> Any: ...
|
||||
Reference in New Issue
Block a user