Visitar URL original
gh-161875: Push NULL and None in GET_ANEXT by asvetlov · Pull Request #161877 · python/cpython · GitHub
Skip to content

gh-161875: Push NULL and None in GET_ANEXT - #161877

Open
asvetlov wants to merge 1 commit into
python:mainfrom
asvetlov:gh-161875-get-anext
Open

asvetlov wants to merge 1 commit into
python:mainfrom
asvetlov:gh-161875-get-anext

Conversation

@asvetlov

@asvetlov asvetlov commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GET_ANEXT was always followed by PUSH_NULL; LOAD_CONST None to set up the stack for SEND. It now pushes (aiter, awaitable, NULL, None) itself, so each async for iteration (including async comprehensions and async generator expressions) runs GET_ANEXT; SEND.

🤖 Generated with Claude Code

Every async for iteration compiled to GET_ANEXT; PUSH_NULL;
LOAD_CONST None; SEND. GET_ANEXT is always followed by that pair, so let
it push (aiter, awaitable, NULL, None) itself, saving two dispatches per
iteration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@asvetlov asvetlov added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 12, 2026
@asvetlov
asvetlov marked this pull request as ready for review November 12, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review interpreter-core (Objects, Python, Grammar, and Parser dirs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant