]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Update _client.py (#2247)
authorWill Frey <13784361+willfrey@users.noreply.github.com>
Thu, 26 May 2022 12:53:31 +0000 (08:53 -0400)
committerGitHub <noreply@github.com>
Thu, 26 May 2022 12:53:31 +0000 (13:53 +0100)
Update the type annotation for the default_encoding parameter of AsyncClient's initializer to accept a callable of the form (bytes) -> str.

httpx/_client.py

index 2ed3f4928512cb07ce470055ae32a295804f95cf..730ab4a5e059f3ce1c9cbccfdc55d5371d5ac854 100644 (file)
@@ -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,