Skip to content

Commit 7706b5a

Browse files
authored
Fix aiohttp.ClientTimeout type annotations to accept None for fields (#3511)
* Fix aiohttp.ClientTimeout type annotations to accept Nonefor fields * Add changelog
1 parent c562ffe commit 7706b5a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGES/3511.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ``aiohttp.ClientTimeout`` type annotations to accept ``None`` for fields

aiohttp/client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@
129129

130130
@attr.s(frozen=True, slots=True)
131131
class ClientTimeout:
132-
total = attr.ib(type=float, default=None)
133-
connect = attr.ib(type=float, default=None)
134-
sock_read = attr.ib(type=float, default=None)
135-
sock_connect = attr.ib(type=float, default=None)
132+
total = attr.ib(type=Optional[float], default=None)
133+
connect = attr.ib(type=Optional[float], default=None)
134+
sock_read = attr.ib(type=Optional[float], default=None)
135+
sock_connect = attr.ib(type=Optional[float], default=None)
136136

137137
# pool_queue_timeout = attr.ib(type=float, default=None)
138138
# dns_resolution_timeout = attr.ib(type=float, default=None)

0 commit comments

Comments
 (0)