diff --git a/CHANGES/3511.bugfix b/CHANGES/3511.bugfix new file mode 100644 index 00000000000..0eef1d06cc1 --- /dev/null +++ b/CHANGES/3511.bugfix @@ -0,0 +1 @@ +Fix ``aiohttp.ClientTimeout`` type annotations to accept ``None`` for fields diff --git a/aiohttp/client.py b/aiohttp/client.py index ef31df8f013..163bb107e45 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -129,10 +129,10 @@ @attr.s(frozen=True, slots=True) class ClientTimeout: - total = attr.ib(type=float, default=None) - connect = attr.ib(type=float, default=None) - sock_read = attr.ib(type=float, default=None) - sock_connect = attr.ib(type=float, default=None) + total = attr.ib(type=Optional[float], default=None) + connect = attr.ib(type=Optional[float], default=None) + sock_read = attr.ib(type=Optional[float], default=None) + sock_connect = attr.ib(type=Optional[float], default=None) # pool_queue_timeout = attr.ib(type=float, default=None) # dns_resolution_timeout = attr.ib(type=float, default=None)