From 94e0625e82b01115b2a4c4c27617d0856c385f43 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 13 Sep 2016 10:07:44 -0700 Subject: [PATCH] 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 --- third_party/2and3/ujson.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/third_party/2and3/ujson.pyi b/third_party/2and3/ujson.pyi index 147f67a56..37697af58 100644 --- a/third_party/2and3/ujson.pyi +++ b/third_party/2and3/ujson.pyi @@ -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: ...