From 9befe5ff004642de334386a56224d74242ce2810 Mon Sep 17 00:00:00 2001 From: Will Frey Date: Wed, 21 Dec 2022 14:00:27 -0500 Subject: [PATCH] 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]`. --- stdlib/json/__init__.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/json/__init__.pyi b/stdlib/json/__init__.pyi index 64ab8a11a..73bb5e8b4 100644 --- a/stdlib/json/__init__.pyi +++ b/stdlib/json/__init__.pyi @@ -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 = ...,