mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Minor improvements to simplejson stubs (#1832)
This fixes signatures of `load` and `loads` and cleans-up `JSONDecodeError`.
This commit is contained in:
6
third_party/2/simplejson/__init__.pyi
vendored
6
third_party/2/simplejson/__init__.pyi
vendored
@@ -1,4 +1,4 @@
|
||||
from typing import Any, IO
|
||||
from typing import Any, IO, Text
|
||||
|
||||
from simplejson.scanner import JSONDecodeError as JSONDecodeError
|
||||
from simplejson.decoder import JSONDecoder as JSONDecoder
|
||||
@@ -6,5 +6,5 @@ from simplejson.encoder import JSONEncoder as JSONEncoder, JSONEncoderForHTML as
|
||||
|
||||
def dumps(obj: Any, *args: Any, **kwds: 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: ...
|
||||
def loads(s: Text, **kwds: Any) -> Any: ...
|
||||
def load(fp: IO[str], **kwds: Any) -> Any: ...
|
||||
|
||||
14
third_party/2/simplejson/scanner.pyi
vendored
14
third_party/2/simplejson/scanner.pyi
vendored
@@ -1,7 +1,11 @@
|
||||
from typing import Any, IO
|
||||
from typing import Optional
|
||||
|
||||
class JSONDecodeError(ValueError):
|
||||
def dumps(self, obj: Any) -> str: ...
|
||||
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: ...
|
||||
msg: str = ...
|
||||
doc: str = ...
|
||||
pos: int = ...
|
||||
end: Optional[int] = ...
|
||||
lineno: int = ...
|
||||
colno: int = ...
|
||||
endlineno: Optional[int] = ...
|
||||
endcolno: Optional[int] = ...
|
||||
|
||||
Reference in New Issue
Block a user