This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author byllyfish
Recipients asvetlov, byllyfish, yselivanov
Date 2021-08-26.05:28:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629955714.55.0.00221644523212.issue45008@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-08-26 05:28:34byllyfishsetrecipients: + byllyfish, asvetlov, yselivanov
2021-08-26 05:28:34byllyfishsetmessageid: <1629955714.55.0.00221644523212.issue45008@roundup.psfhosted.org>
2021-08-26 05:28:34byllyfishlinkissue45008 messages
2021-08-26 05:28:34byllyfishcreate