json.load can also take IO[bytes] in py36+ (#2188)

This commit is contained in:
Anthony Sottile
2018-06-03 19:02:55 -07:00
committed by Jelle Zijlstra
parent a25ff0bddf
commit 2d4bb04ab3

View File

@@ -41,7 +41,11 @@ def loads(s: Union[str, bytes, bytearray],
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
**kwds: Any) -> Any: ...
def load(fp: IO[str],
if sys.version_info >= (3, 6):
_LoadIO = IO[Any]
else:
_LoadIO = IO[str]
def load(fp: _LoadIO,
cls: Any = ...,
object_hook: Optional[Callable[[Dict], Any]] = ...,
parse_float: Optional[Callable[[str], Any]] = ...,