mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 10:51:15 +08:00
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:
@@ -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 = ...,
|
||||
|
||||
Reference in New Issue
Block a user