From 7706b5a106ec535f05074f294a966cbcefe19390 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 9 Jan 2019 18:09:45 +0200 Subject: [PATCH] Fix aiohttp.ClientTimeout type annotations to accept None for fields (#3511) * Fix aiohttp.ClientTimeout type annotations to accept Nonefor fields * Add changelog --- CHANGES/3511.bugfix | 1 + aiohttp/client.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 CHANGES/3511.bugfix 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)