Created
February 20, 2026 21:44
-
-
Save carljm/b96241cf74dba1f9d25930d4812b8e06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"dependencies": []} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from typing_extensions import reveal_type | |
| async def task() -> tuple[int, str]: ... | |
| async def test() -> None: | |
| futures: set[asyncio.Task[tuple[int, str]]] = { | |
| asyncio.create_task(task()) for _ in range(3) | |
| } | |
| while True: | |
| wait = asyncio.wait(futures, return_when=asyncio.FIRST_COMPLETED) | |
| try: | |
| done, futures = await asyncio.wait_for(wait, 3) | |
| except Exception: | |
| return | |
| reveal_type(wait) | |
| reveal_type(done) | |
| reveal_type(futures) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [rules] | |
| empty-body = "ignore" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment