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:
Tim Abbott
2016-09-13 10:07:44 -07:00
committed by Guido van Rossum
parent 052574d821
commit 94e0625e82

View File

@@ -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: ...