From 6569deaa4493cec379bc984b506bf9fb04b5a8bf Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 31 Oct 2022 02:26:48 +0300 Subject: [PATCH] json: improve bytes handling (#9042) --- stdlib/json/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/json/__init__.pyi b/stdlib/json/__init__.pyi index 2fd87622e..64ab8a11a 100644 --- a/stdlib/json/__init__.pyi +++ b/stdlib/json/__init__.pyi @@ -37,7 +37,7 @@ def dump( **kwds: Any, ) -> None: ... def loads( - s: str | bytes, + s: str | bytes | bytearray, *, cls: type[JSONDecoder] | None = ..., object_hook: Callable[[dict[Any, Any]], Any] | None = ..., @@ -58,4 +58,4 @@ def load( object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ..., **kwds: Any, ) -> Any: ... -def detect_encoding(b: bytes) -> str: ... # undocumented +def detect_encoding(b: bytes | bytearray) -> str: ... # undocumented