|
4 | 4 |
|
5 | 5 | ## Async support |
6 | 6 |
|
7 | | -*Cluster: async · Cost: ? · Gate: none · Filed: 2026-10-09 · See also: `mcpyrate`'s `TODO_DEFERRED.md`, "Async support: block macros on `async with`, decorator macros on `async def`"* |
| 7 | +*Cluster: async · Cost: ? · Gate: none · Filed: 2026-10-09 · See also: GitHub #4 (open, "Help wanted for testing async support"); `mcpyrate`'s `TODO_DEFERRED.md`, "Async support: block macros on `async with`, decorator macros on `async def`"* |
8 | 8 |
|
9 | 9 | Async is not supported much anywhere in the fleet (maintainer, 2026-10-09: there are places it would be |
10 | | -useful), and `unpythonic` and `mcpyrate` are where adding it would be worth the most. Not yet surveyed here: |
11 | | -`unpythonic.syntax` mentions async AST nodes in seven modules (`autocurry`, `letdo`, `tailtools`, `util`, |
12 | | -`lambdatools`, `scopeanalyzer`, `lazify`), so some of its walkers know them, but which constructs work with |
13 | | -`async def`, `await` and `async with`, at the macro layer and the runtime layer alike, is not known. Part of |
14 | | -the macro layer depends on `mcpyrate` expanding macros on async constructs at all. |
| 10 | +useful), and `unpythonic` and `mcpyrate` are where adding it would be worth the most. |
| 11 | + |
| 12 | +What exists, from the history: |
| 13 | + |
| 14 | +- **`typecheck` knows the async types** (2026-03-12): `Awaitable`/`Coroutine`, `AsyncIterable`/`AsyncIterator`, |
| 15 | + `AsyncGenerator` and `AsyncContextManager` work in `isoftype`, and so in `@generic` dispatch. |
| 16 | +- **Two constructs refuse async, on purpose**: `with continuations` raises `SyntaxError` on `async def` or |
| 17 | + `await` inside its block (2021, citing #4), and multi-shot generators (2.2.0) document async as out of |
| 18 | + scope. |
| 19 | +- **`unpythonic.syntax` mentions async AST nodes in seven modules** (`autocurry`, `letdo`, `tailtools`, |
| 20 | + `util`, `lambdatools`, `scopeanalyzer`, `lazify`), so some walkers know them; what that amounts to per |
| 21 | + macro has not been surveyed. |
| 22 | +- `async_raise` is unrelated despite its name: it injects an exception into another thread. |
| 23 | + |
| 24 | +Part of the macro layer depends on `mcpyrate` expanding macros on async constructs at all. |
15 | 25 |
|
16 | 26 | ## Dispatch: indistinguishable parametric ABC multimethods (GitHub #99) |
17 | 27 |
|
|
0 commit comments