@@ -68,6 +68,7 @@ _T2 = TypeVar("_T2")
68
68
_T3 = TypeVar ("_T3" )
69
69
_T4 = TypeVar ("_T4" )
70
70
_T5 = TypeVar ("_T5" )
71
+ _T6 = TypeVar ("_T6" )
71
72
_FT = TypeVar ("_FT" , bound = Future [Any ])
72
73
_FutureLike : TypeAlias = Future [_T ] | Generator [Any , None , _T ] | Awaitable [_T ]
73
74
_TaskYieldType : TypeAlias = Future [object ] | None
@@ -131,6 +132,19 @@ if sys.version_info >= (3, 10):
131
132
return_exceptions : Literal [False ] = False ,
132
133
) -> Future [tuple [_T1 , _T2 , _T3 , _T4 , _T5 ]]: ...
133
134
@overload
135
+ def gather ( # type: ignore[misc]
136
+ __coro_or_future1 : _FutureLike [_T1 ],
137
+ __coro_or_future2 : _FutureLike [_T2 ],
138
+ __coro_or_future3 : _FutureLike [_T3 ],
139
+ __coro_or_future4 : _FutureLike [_T4 ],
140
+ __coro_or_future5 : _FutureLike [_T5 ],
141
+ __coro_or_future6 : _FutureLike [_T6 ],
142
+ * ,
143
+ return_exceptions : Literal [False ] = False ,
144
+ ) -> Future [tuple [_T1 , _T2 , _T3 , _T4 , _T5 , _T6 ]]: ...
145
+ @overload
146
+ def gather (* coros_or_futures : _FutureLike [_T ], return_exceptions : Literal [False ] = False ) -> Future [list [_T ]]: ... # type: ignore[misc]
147
+ @overload
134
148
def gather (__coro_or_future1 : _FutureLike [_T1 ], * , return_exceptions : bool ) -> Future [tuple [_T1 | BaseException ]]: ... # type: ignore[misc]
135
149
@overload
136
150
def gather ( # type: ignore[misc]
@@ -166,7 +180,27 @@ if sys.version_info >= (3, 10):
166
180
tuple [_T1 | BaseException , _T2 | BaseException , _T3 | BaseException , _T4 | BaseException , _T5 | BaseException ]
167
181
]: ...
168
182
@overload
169
- def gather (* coros_or_futures : _FutureLike [Any ], return_exceptions : bool = False ) -> Future [list [Any ]]: ...
183
+ def gather ( # type: ignore[misc]
184
+ __coro_or_future1 : _FutureLike [_T1 ],
185
+ __coro_or_future2 : _FutureLike [_T2 ],
186
+ __coro_or_future3 : _FutureLike [_T3 ],
187
+ __coro_or_future4 : _FutureLike [_T4 ],
188
+ __coro_or_future5 : _FutureLike [_T5 ],
189
+ __coro_or_future6 : _FutureLike [_T6 ],
190
+ * ,
191
+ return_exceptions : bool ,
192
+ ) -> Future [
193
+ tuple [
194
+ _T1 | BaseException ,
195
+ _T2 | BaseException ,
196
+ _T3 | BaseException ,
197
+ _T4 | BaseException ,
198
+ _T5 | BaseException ,
199
+ _T6 | BaseException ,
200
+ ]
201
+ ]: ...
202
+ @overload
203
+ def gather (* coros_or_futures : _FutureLike [_T ], return_exceptions : bool ) -> Future [list [_T | BaseException ]]: ...
170
204
171
205
else :
172
206
@overload
@@ -212,6 +246,22 @@ else:
212
246
return_exceptions : Literal [False ] = False ,
213
247
) -> Future [tuple [_T1 , _T2 , _T3 , _T4 , _T5 ]]: ...
214
248
@overload
249
+ def gather ( # type: ignore[misc]
250
+ __coro_or_future1 : _FutureLike [_T1 ],
251
+ __coro_or_future2 : _FutureLike [_T2 ],
252
+ __coro_or_future3 : _FutureLike [_T3 ],
253
+ __coro_or_future4 : _FutureLike [_T4 ],
254
+ __coro_or_future5 : _FutureLike [_T5 ],
255
+ __coro_or_future6 : _FutureLike [_T6 ],
256
+ * ,
257
+ loop : AbstractEventLoop | None = None ,
258
+ return_exceptions : Literal [False ] = False ,
259
+ ) -> Future [tuple [_T1 , _T2 , _T3 , _T4 , _T5 , _T6 ]]: ...
260
+ @overload
261
+ def gather ( # type: ignore[misc]
262
+ * coros_or_futures : _FutureLike [_T ], loop : AbstractEventLoop | None = None , return_exceptions : Literal [False ] = False
263
+ ) -> Future [list [_T ]]: ...
264
+ @overload
215
265
def gather ( # type: ignore[misc]
216
266
__coro_or_future1 : _FutureLike [_T1 ], * , loop : AbstractEventLoop | None = None , return_exceptions : bool
217
267
) -> Future [tuple [_T1 | BaseException ]]: ...
@@ -249,16 +299,24 @@ else:
249
299
__coro_or_future3 : _FutureLike [_T3 ],
250
300
__coro_or_future4 : _FutureLike [_T4 ],
251
301
__coro_or_future5 : _FutureLike [_T5 ],
302
+ __coro_or_future6 : _FutureLike [_T6 ],
252
303
* ,
253
304
loop : AbstractEventLoop | None = None ,
254
305
return_exceptions : bool ,
255
306
) -> Future [
256
- tuple [_T1 | BaseException , _T2 | BaseException , _T3 | BaseException , _T4 | BaseException , _T5 | BaseException ]
307
+ tuple [
308
+ _T1 | BaseException ,
309
+ _T2 | BaseException ,
310
+ _T3 | BaseException ,
311
+ _T4 | BaseException ,
312
+ _T5 | BaseException ,
313
+ _T6 | BaseException ,
314
+ ]
257
315
]: ...
258
316
@overload
259
- def gather (
260
- * coros_or_futures : _FutureLike [Any ], loop : AbstractEventLoop | None = None , return_exceptions : bool = False
261
- ) -> Future [list [Any ]]: ...
317
+ def gather ( # type: ignore[misc]
318
+ * coros_or_futures : _FutureLike [_T ], loop : AbstractEventLoop | None = None , return_exceptions : bool
319
+ ) -> Future [list [_T | BaseException ]]: ...
262
320
263
321
def run_coroutine_threadsafe (coro : _FutureLike [_T ], loop : AbstractEventLoop ) -> concurrent .futures .Future [_T ]: ...
264
322
0 commit comments