mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Fix ujson stubs to properly use AnyStr. (#540)
The ujson module apparently will accept both bytes and text format input, however, it does always output a str (both on Python 2 and Python 3). Some discussion in: https://github.com/python/typeshed/pull/460
This commit is contained in:
committed by
Guido van Rossum
parent
052574d821
commit
94e0625e82
8
third_party/2and3/ujson.pyi
vendored
8
third_party/2and3/ujson.pyi
vendored
@@ -1,6 +1,6 @@
|
||||
# Stubs for ujson
|
||||
# See: https://pypi.python.org/pypi/ujson
|
||||
from typing import Any, IO, Optional
|
||||
from typing import Any, AnyStr, IO, Optional
|
||||
|
||||
__version__ = ... # type: str
|
||||
|
||||
@@ -32,14 +32,14 @@ def dump(obj: Any,
|
||||
indent: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
def decode(s: str,
|
||||
def decode(s: AnyStr,
|
||||
precise_float: bool = ...,
|
||||
) -> Any: ...
|
||||
|
||||
def loads(s: str,
|
||||
def loads(s: AnyStr,
|
||||
precise_float: bool = ...,
|
||||
) -> Any: ...
|
||||
|
||||
def load(fp: IO[str],
|
||||
def load(fp: IO[AnyStr],
|
||||
precise_float: bool = ...,
|
||||
) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user