From: Will Frey <13784361+willfrey@users.noreply.github.com> Date: Thu, 26 May 2022 12:53:31 +0000 (-0400) Subject: Update _client.py (#2247) X-Git-Tag: 0.23.1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b06aea1d64f0815af6fe71da3ac725bed3ec09f;p=thirdparty%2Fhttpx.git Update _client.py (#2247) Update the type annotation for the default_encoding parameter of AsyncClient's initializer to accept a callable of the form (bytes) -> str. --- diff --git a/httpx/_client.py b/httpx/_client.py index 2ed3f492..730ab4a5 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -1363,7 +1363,7 @@ class AsyncClient(BaseClient): transport: typing.Optional[AsyncBaseTransport] = None, app: typing.Optional[typing.Callable] = None, trust_env: bool = True, - default_encoding: str = "utf-8", + default_encoding: typing.Union[str, typing.Callable[[bytes], str]] = "utf-8", ): super().__init__( auth=auth,