From: Joe <10510431+j178@users.noreply.github.com> Date: Wed, 1 Jan 2020 13:45:38 +0000 (+0800) Subject: Make timeout parameter None-able & cleanup __all__. (#704) X-Git-Tag: 0.11.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5d4bb80742445804d4bd7d686395c0d8648ca86;p=thirdparty%2Fhttpx.git Make timeout parameter None-able & cleanup __all__. (#704) * Timeout type annotation includes `None`. * Cleanup `__all__` exports. --- diff --git a/httpx/__init__.py b/httpx/__init__.py index 61346d0e..caaa81a9 100644 --- a/httpx/__init__.py +++ b/httpx/__init__.py @@ -71,8 +71,6 @@ __all__ = [ "ProxyError", "TooManyRedirects", "WriteTimeout", - "BaseSocketStream", - "ConcurrencyBackend", "URL", "StatusCode", "Cookies", diff --git a/httpx/config.py b/httpx/config.py index 86fb4434..0e837a23 100644 --- a/httpx/config.py +++ b/httpx/config.py @@ -10,7 +10,9 @@ from .utils import get_ca_bundle_from_env, get_logger CertTypes = typing.Union[str, typing.Tuple[str, str], typing.Tuple[str, str, str]] VerifyTypes = typing.Union[str, bool, ssl.SSLContext] -TimeoutTypes = typing.Union[float, typing.Tuple[float, float, float, float], "Timeout"] +TimeoutTypes = typing.Union[ + None, float, typing.Tuple[float, float, float, float], "Timeout" +] USER_AGENT = f"python-httpx/{__version__}" diff --git a/httpx/models.py b/httpx/models.py index fe42e3c2..401bf49a 100644 --- a/httpx/models.py +++ b/httpx/models.py @@ -46,7 +46,6 @@ from .utils import ( ) if typing.TYPE_CHECKING: # pragma: no cover - from .middleware.base import BaseMiddleware # noqa: F401 from .dispatch.base import Dispatcher # noqa: F401 PrimitiveData = typing.Optional[typing.Union[str, int, float, bool]]