Title: gh-93691: Compiler's code-gen passes location around instead of holding it on the global compiler state by iritkatriel · Pull Request #98001 · python/cpython · GitHub
Open Graph Title: gh-93691: Compiler's code-gen passes location around instead of holding it on the global compiler state by iritkatriel · Pull Request #98001 · python/cpython
X Title: gh-93691: Compiler's code-gen passes location around instead of holding it on the global compiler state by iritkatriel · Pull Request #98001 · python/cpython
Description: This implements #93691 (comment). The line numbers are almost identical to those we calculated before (see the individual commits if you're interested in the process I followed). There were a few place (around annotations, for instance) where the line number was not set so it remained whatever it was before. I didn't bother going through hoops to make this backwards compatible because it's obviously wrong. I just take the line number from the current AST node. In a few places (like pattern matching) I pass around a pointer to the location which can be updated deep in the recursion. This is not how it should be, but it's how it was until now (the global was updated in the recursion and impacted further nodes). So I used pointers to emulate this and get similar results, but my intention is to get rid of these pointers in the future, and just take locations from the relevant, current, AST node. Issue: gh-93691
Open Graph Description: This implements #93691 (comment). The line numbers are almost identical to those we calculated before (see the individual commits if you're interested in the process I followed). There were a...
X Description: This implements #93691 (comment). The line numbers are almost identical to those we calculated before (see the individual commits if you're interested in the process I followed). There we...
Opengraph URL: https://github.com/python/cpython/pull/98001
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:321e8c3d-b40e-6e7c-6e85-2e358f68a972 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | E3D2:8A288:626B6E:85248B:6969B514 |
| html-safe-nonce | ac19e763d2fff389580bcf2f867f5ca5cea50586fcaa77894a260296ad55c340 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0QyOjhBMjg4OjYyNkI2RTo4NTI0OEI6Njk2OUI1MTQiLCJ2aXNpdG9yX2lkIjoiMjk1NjUyNDUwMDQyMjM0MTkwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a76bf14cb79643ce7fbec9945cb6de93f11cc89e3737fc9abaccb4337483e48e |
| hovercard-subject-tag | pull_request:1079695479 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/98001/checks |
| twitter:image | https://avatars.githubusercontent.com/u/1055913?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1055913?s=400&v=4 |
| og:image:alt | This implements #93691 (comment). The line numbers are almost identical to those we calculated before (see the individual commits if you're interested in the process I followed). There were a... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b23b8fcc855cd29bb04d6c94aafa62d336bf44eefa8229444eecc968cad03aee |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0672399d88424758731ec07fe24509e23bb17fb5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width