Skip to content

Commit a41c18e

Browse files
committed
minor change
1 parent 3847eef commit a41c18e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/get_reference_to_original_future_when_use_as_completed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ async def coro(sec):
99

1010

1111
async def main():
12-
futures = {asyncio.ensure_future(coro(i)): i for i in range(1,5)}
12+
futures = {asyncio.ensure_future(coro(i)): f'item({i})' for i in range(1,5)}
1313

1414
for future in as_completed_hooked(futures.keys()):
1515
real_future = await future
1616
index = futures[real_future]
17-
print(f'The index is {index}')
17+
print(f'The item is {index}')
1818
print(f'The result is {real_future.result()}')
1919

2020

0 commit comments

Comments
 (0)