-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
The following code takes 4 seconds to run. If the values in the dictionary can be calculated in parallel, it only takes 2 seconds.
import asyncio
import time
async def main():
start = time.time()
dic = {
'a': await asyncio.sleep(2),
'b': await asyncio.sleep(2)
}
end = time.time()
print(f'elapsed time: {end - start} seconds')
asyncio.run(main())
Current output:
elapsed time: 4 seconds
Expected output:
elapsed time: 2 seconds
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement