Update json.dump to only require fp: SupportsWrite[str] (#9396)

Presently, `json.dump` requires `fp` be of type `IO[str]` but in reality and according to the docs, `json.dump` only requires ` SupportsWrite[str]`.
This commit is contained in:
Will Frey
2022-12-21 14:00:27 -05:00
committed by GitHub
parent 0659e3c574
commit 9befe5ff00

View File

@@ -1,6 +1,6 @@
from _typeshed import SupportsRead
from _typeshed import SupportsRead, SupportsWrite
from collections.abc import Callable
from typing import IO, Any
from typing import Any
from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder
from .encoder import JSONEncoder as JSONEncoder
@@ -23,7 +23,7 @@ def dumps(
) -> str: ...
def dump(
obj: Any,
fp: IO[str],
fp: SupportsWrite[str],
*,
skipkeys: bool = ...,
ensure_ascii: bool = ...,