Message400309
asyncio.gather uses a dictionary to de-duplicate futures and coros. However, this can lead to problems when
you pass an awaitable object (implements __await__ but isn't a future or coro).
1. Two or more awaitables may compare for equality/hash, but still expect to produce different results (See the RandBits class in gather_test.py)
2. If an awaitable doesn't support hashing, asyncio.gather doesn't work.
Would it be possible for non-future, non-coro awaitables to opt out of the dedup logic?
The attached file shows an awaitable RandBits class. Each time you await it, you should get a different
result. Using gather, you will always get the same result. |
|
Date |
User |
Action |
Args |
2021-08-26 05:28:34 | byllyfish | set | recipients:
+ byllyfish, asvetlov, yselivanov |
2021-08-26 05:28:34 | byllyfish | set | messageid: <1629955714.55.0.00221644523212.issue45008@roundup.psfhosted.org> |
2021-08-26 05:28:34 | byllyfish | link | issue45008 messages |
2021-08-26 05:28:34 | byllyfish | create | |
|