Skip to content

[mypyc] Report an error for async generator expressions - #22247

Merged
JukkaL merged 1 commit into
masterfrom
mypyc-async-gen-expr
Oct 21, 2026
Merged

JukkaL merged 1 commit into
masterfrom
mypyc-async-gen-expr

Conversation

@JukkaL

@JukkaL JukkaL commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

An async generator expression (one that uses 'async for' or 'await') was compiled into a list and a regular iterator over it, which can't be used with 'async for', so using the result always failed at runtime. Report a compile error instead, since async generators aren't supported.

An 'await' in the first iterable is fine, since it's evaluated in the enclosing function.

An async generator expression (one that uses 'async for' or 'await')
was compiled into a list and a regular iterator over it, which can't be
used with 'async for', so using the result always failed at runtime.
Report a compile error instead, since async generators aren't supported.

An 'await' in the first iterable is fine, since it's evaluated in the
enclosing function.
@JukkaL
JukkaL merged commit 6ff2361 into master Oct 21, 2026
18 checks passed
@JukkaL
JukkaL deleted the mypyc-async-gen-expr branch October 21, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants