Commit 810dfa5
authored
[asyncio.tasks] Fix return type of
When as_completed() is iterated with a regular for loop (not async
for), it yields coroutines, not Futures. The previous stub incorrectly
typed the sync iterator path as Iterator[Future[_T]] which would
allow calling .result() without a type error even though that crashes
at runtime with AttributeError.as_completed (#15672)1 parent ac78486 commit 810dfa5
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
0 commit comments