Title: Remove `DELETE_FAST` bytecode instruction · Issue #145749 · python/cpython · GitHub
Open Graph Title: Remove `DELETE_FAST` bytecode instruction · Issue #145749 · python/cpython
X Title: Remove `DELETE_FAST` bytecode instruction · Issue #145749 · python/cpython
Description: DELETE_FAST has two uses: delete var where var is a local variable Cleaning up at the end of a named exception block. A local variable can be deleted with the sequence PUSH_NULL; STORE_FAST var. Deleting a local variable Instead of DELET...
Open Graph Description: DELETE_FAST has two uses: delete var where var is a local variable Cleaning up at the end of a named exception block. A local variable can be deleted with the sequence PUSH_NULL; STORE_FAST var. De...
X Description: DELETE_FAST has two uses: delete var where var is a local variable Cleaning up at the end of a named exception block. A local variable can be deleted with the sequence PUSH_NULL; STORE_FAST var. De...
Opengraph URL: https://github.com/python/cpython/issues/145749
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove `DELETE_FAST` bytecode instruction","articleBody":"`DELETE_FAST` has two uses:\n1. `delete var` where `var` is a local variable\n2. Cleaning up at the end of a named exception block.\n\nA local variable can be deleted with the sequence `PUSH_NULL; STORE_FAST var`.\n\n#### Deleting a local variable\n\nInstead of `DELETE_FAST n` we can emit `LOAD_FAST n; POP_TOP n; PUSH_NULL; STORE_FAST n` which the bytecode optimizer will reduce to `PUSH_NULL; STORE_FAST n` in most cases.\n\n#### Cleaning up at the end of a named exception block.\n\nWe currently emit the sequence: `LOAD_CONST None; STORE_FAST n; DELETE_FAST n`\nwhich can be replaced with `PUSH_NULL; STORE_FAST n`\n\nThis case is far more common than explicitly deleting a local variable, so we can reduce code size as well as freeing up an opcode.\n\n---------------------------------\n\nSee https://github.com/faster-cpython/ideas/issues/490\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-145983\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2026-03-10T14:02:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/145749/cpython/issues/145749"}
| 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:c219be36-3d62-6b82-7e92-b774c7e0e8f9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA28:12E3C6:4D33EB:65EC53:6A518384 |
| html-safe-nonce | 006093e3c09d82dd8f8176e8e1a70261d5357784d9117b9bb06bd4a738860f9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTI4OjEyRTNDNjo0RDMzRUI6NjVFQzUzOjZBNTE4Mzg0IiwidmlzaXRvcl9pZCI6IjQ3MzYxNzIyMTAxODU1MTE3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 54543de202315c2fbc8b87a79bdc0df60bff6d852bd24f797b921d606520970f |
| hovercard-subject-tag | issue:4052024144 |
| 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/145749/issue_layout |
| twitter:image | https://opengraph.githubassets.com/194b900d820e58a696dad352fc77187802a15d67d0e3646444f6f19627dd4d38/python/cpython/issues/145749 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/194b900d820e58a696dad352fc77187802a15d67d0e3646444f6f19627dd4d38/python/cpython/issues/145749 |
| og:image:alt | DELETE_FAST has two uses: delete var where var is a local variable Cleaning up at the end of a named exception block. A local variable can be deleted with the sequence PUSH_NULL; STORE_FAST var. De... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | d01c62704ef24df49056c63892a149b775e1353d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width