Title: gh-104602: ensure all cellvars are known up front by carljm · Pull Request #104603 · python/cpython · GitHub
Open Graph Title: gh-104602: ensure all cellvars are known up front by carljm · Pull Request #104603 · python/cpython
X Title: gh-104602: ensure all cellvars are known up front by carljm · Pull Request #104603 · python/cpython
Description: Because u_cellvars and u_freevars share the same index-space and must not reuse the same indices, all cellvars must be populated in compiler_enter_scope, and never lazily. (So that freevars can begin at the right index offset.) This means that compiler_enter_scope must already know about all cellvars up front, including those in inlined comprehensions. But we can't promote all inlined-comprehension cells to be handled as cells throughout the function; if the name is global in outer scope, it must stay that way in order to resolve names correctly. So we need the symtable to record the fact that a symbol is a cellvar in an inlined scope, so compiler_enter_scope can include it in u_cellvars. This issue only shows up in the case where we have an inlined comprehension containing both a cell var and a free var, and the cell var is a global in the outer scope. Issue: gh-104602
Open Graph Description: Because u_cellvars and u_freevars share the same index-space and must not reuse the same indices, all cellvars must be populated in compiler_enter_scope, and never lazily. (So that freevars can beg...
X Description: Because u_cellvars and u_freevars share the same index-space and must not reuse the same indices, all cellvars must be populated in compiler_enter_scope, and never lazily. (So that freevars can beg...
Opengraph URL: https://github.com/python/cpython/pull/104603
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:72415ebb-88e4-3db5-27e5-85c158bbae2c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C9C0:284E5C:21E8A1:2F0548:696A65AA |
| html-safe-nonce | a9aa770861b1a829976dc7dfeb4bab2d4443d58992b1a6ccc006e07941ad1a25 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUMwOjI4NEU1QzoyMUU4QTE6MkYwNTQ4OjY5NkE2NUFBIiwidmlzaXRvcl9pZCI6IjI4NTg3ODI1NDIzOTI4Nzg1MDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a121fdcbd59a57b2d441404f239e78bc4848fbde6e2ac09aaaf6a4c648e3a79b |
| hovercard-subject-tag | pull_request:1355119545 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/104603/files |
| twitter:image | https://avatars.githubusercontent.com/u/61586?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/61586?s=400&v=4 |
| og:image:alt | Because u_cellvars and u_freevars share the same index-space and must not reuse the same indices, all cellvars must be populated in compiler_enter_scope, and never lazily. (So that freevars can beg... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b7735a184970dd9333b2cbe036c8f3c0a9108c64aaa93827c5a64fc70993392 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 87cbd411c2982752221b5751d583a515b23bf5fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width