Title: Assigning `__conditional_annotations__` crashes the interpreter · Issue #154902 · python/cpython · GitHub
Open Graph Title: Assigning `__conditional_annotations__` crashes the interpreter · Issue #154902 · python/cpython
X Title: Assigning `__conditional_annotations__` crashes the interpreter · Issue #154902 · python/cpython
Description: Crash report What happened? In CPython 3.14 and later, assigning to the global __conditional_annotations__ before a variable annotation produces a segfault. Here is a minimal reproducible example: __conditional_annotations__ = 0 a: 1 Ana...
Open Graph Description: Crash report What happened? In CPython 3.14 and later, assigning to the global __conditional_annotations__ before a variable annotation produces a segfault. Here is a minimal reproducible example: ...
X Description: Crash report What happened? In CPython 3.14 and later, assigning to the global __conditional_annotations__ before a variable annotation produces a segfault. Here is a minimal reproducible example: ...
Opengraph URL: https://github.com/python/cpython/issues/154902
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assigning `__conditional_annotations__` crashes the interpreter","articleBody":"# Crash report\n\n### What happened?\n\nIn CPython 3.14 and later, assigning to the global `__conditional_annotations__` before a variable annotation produces a segfault.\n\nHere is a minimal reproducible example:\n\n```python\n__conditional_annotations__ = 0\na: 1\n```\n\nAnalyzing the bytecode, the compiler first initializes `__conditional_annotations__` to an empty set. Whenever an annotation is declared, a `SET_ADD` is emitted under the assumption that the underlying type is still a set. But we can re-assign `__conditional_annotations__` to another object in between, leading to a type confusion:\n\n```python\nBUILD_SET 0\nSTORE_NAME 0 (__conditional_annotations__)\nLOAD_SMALL_INT 0\nSTORE_NAME 0 (__conditional_annotations__)\n\nLOAD_NAME 0 (__conditional_annotations__)\nLOAD_SMALL_INT 0\nSET_ADD 1\n```\n\n### CPython versions tested on:\n\n3.14, 3.15\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-155026\n* gh-155071\n* gh-155072\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/Lydxn","@type":"Person","name":"Lydxn"},"datePublished":"2026-07-30T00:47:53Z","url":"https://github.com/python/cpython/issues/154902"}
| 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:4a02460c-4b15-fa8f-a1d9-e0b768b5b5c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB6E:14EB6E:14CA1E5:1B5C814:6B01F3A7 |
| html-safe-nonce | 2365c29ccb9e466cba4953d5b4a691d2648d5daf493c9cec4cd641c2c8d77a2a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjZFOjE0RUI2RToxNENBMUU1OjFCNUM4MTQ6NkIwMUYzQTciLCJ2aXNpdG9yX2lkIjoiNjEzMTYzODY0OTUwODQ1OTQzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f5fce10e0a2ec3b47f21ffd7995890b77d4c05cfd10b688b62414cef7007de7a |
| hovercard-subject-tag | issue:5014879235 |
| 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/154902/issue_layout |
| twitter:image | https://opengraph.githubassets.com/70b22d763aef4d795afc6340e8257fd4fb04aa6ad2aed415f8bc9a10f21419b6/python/cpython/issues/154902 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/70b22d763aef4d795afc6340e8257fd4fb04aa6ad2aed415f8bc9a10f21419b6/python/cpython/issues/154902 |
| og:image:alt | Crash report What happened? In CPython 3.14 and later, assigning to the global __conditional_annotations__ before a variable annotation produces a segfault. Here is a minimal reproducible example: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lydxn |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width