Title: Fold PUSH_NULL; LOAD_CONST None into GET_AWAITABLE and GET_ANEXT · Issue #161875 · python/cpython · GitHub
Open Graph Title: Fold PUSH_NULL; LOAD_CONST None into GET_AWAITABLE and GET_ANEXT · Issue #161875 · python/cpython
X Title: Fold PUSH_NULL; LOAD_CONST None into GET_AWAITABLE and GET_ANEXT · Issue #161875 · python/cpython
Description: Feature or enhancement Since gh-145667, SEND takes (receiver, null_or_index, value). As a result, every await and every async for iteration compiles to: GET_AWAITABLE / GET_ANEXT PUSH_NULL LOAD_COMMON_CONSTANT 7 (None) SEND Both opcodes ...
Open Graph Description: Feature or enhancement Since gh-145667, SEND takes (receiver, null_or_index, value). As a result, every await and every async for iteration compiles to: GET_AWAITABLE / GET_ANEXT PUSH_NULL LOAD_COM...
X Description: Feature or enhancement Since gh-145667, SEND takes (receiver, null_or_index, value). As a result, every await and every async for iteration compiles to: GET_AWAITABLE / GET_ANEXT PUSH_NULL LOAD_COM...
Opengraph URL: https://github.com/python/cpython/issues/161875
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fold PUSH_NULL; LOAD_CONST None into GET_AWAITABLE and GET_ANEXT","articleBody":"### Feature or enhancement\n\nSince gh-145667, `SEND` takes `(receiver, null_or_index, value)`. As a result, every `await` and every\n`async for` iteration compiles to:\n\n```\nGET_AWAITABLE / GET_ANEXT\nPUSH_NULL\nLOAD_COMMON_CONSTANT 7 (None)\nSEND\n```\n\nBoth opcodes are only ever emitted immediately before this pair. I propose that they push the NULL and\nthe `None` themselves:\n\n* `GET_AWAITABLE`: `(iterable -- iter, null, none)`\n* `GET_ANEXT`: `(aiter -- aiter, awaitable, null, none)`\n\nThis saves two dispatches per `await` and per `async for` step. Opnames and opargs are unchanged and\n`SEND` is untouched, so this is only a stack-effect change, like the one `GET_ITER` got in gh-132554.\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n* gh-132554, gh-145667\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-161876\n* gh-161877\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/asvetlov","@type":"Person","name":"asvetlov"},"datePublished":"2026-11-12T14:36:12Z","url":"https://github.com/python/cpython/issues/161875"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:246fdff8-cb90-82e1-4fd9-1878f2567c73 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCF2:65478:36E86DC:48D8EFD:6B020276 |
| html-safe-nonce | e3425501a884863e748d6b82e8f160f7d415094ff9617e69c7e5a9c09ff5f0ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0YyOjY1NDc4OjM2RTg2REM6NDhEOEVGRDo2QjAyMDI3NiIsInZpc2l0b3JfaWQiOiI3MDA0MjY5ODQ1MzQ5MDA3OTkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 473444f204d8553bc548d06f782d93b887dc69ef8c8b13afc611e238c11dc368 |
| hovercard-subject-tag | issue:6352093561 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/161875/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68d9dc02c0d9a818e6acb3cd211c7be3f25b11dfc55f6a774a90e5077d898913/python/cpython/issues/161875 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68d9dc02c0d9a818e6acb3cd211c7be3f25b11dfc55f6a774a90e5077d898913/python/cpython/issues/161875 |
| og:image:alt | Feature or enhancement Since gh-145667, SEND takes (receiver, null_or_index, value). As a result, every await and every async for iteration compiles to: GET_AWAITABLE / GET_ANEXT PUSH_NULL LOAD_COM... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | asvetlov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width