René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:56555a8d-9851-3e3d-5531-41610092fcb4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD79A:274FD0:11B5A51:17F5A2E:69699385
html-safe-nonce8e8e9ce24352612c473e5f9a65f87683fb92fef0f6fcd796164eaa4572f97683
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzlBOjI3NEZEMDoxMUI1QTUxOjE3RjVBMkU6Njk2OTkzODUiLCJ2aXNpdG9yX2lkIjoiNTc1ODUxOTY5NjQyMzQ5MDQzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0ad5c3910a896fcda00f482418e983bf84a4fe10965d108fb0cc51d18021e08b
hovercard-subject-tagpull_request:1079695479
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/98001/files
twitter:imagehttps://avatars.githubusercontent.com/u/1055913?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1055913?s=400&v=4
og:image:altThis 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseaf80af7cc9e3de9c336f18b208a600950a3c187c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/98001/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F98001%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F98001%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/98001/files
Reloadhttps://github.com/python/cpython/pull/98001/files
Reloadhttps://github.com/python/cpython/pull/98001/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/98001/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/98001/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
iritkatrielhttps://github.com/iritkatriel
python:mainhttps://github.com/python/cpython/tree/main
iritkatriel:linenoshttps://github.com/iritkatriel/cpython/tree/linenos
Conversation 21 https://github.com/python/cpython/pull/98001
Commits 13 https://github.com/python/cpython/pull/98001/commits
Checks 0 https://github.com/python/cpython/pull/98001/checks
Files changed https://github.com/python/cpython/pull/98001/files
Please reload this pagehttps://github.com/python/cpython/pull/98001/files
gh-93691: Compiler's code-gen passes location around instead of holding it on the global compiler state https://github.com/python/cpython/pull/98001/files#top
Show all changes 13 commits https://github.com/python/cpython/pull/98001/files
ecfa12e pass location into the various ADDOPs iritkatriel Sep 29, 2022 https://github.com/python/cpython/pull/98001/commits/ecfa12e61f669723f065f1631983c28f9b85ea3b
082625c Pass locations around instead of using the one on the compiler state.… iritkatriel Sep 30, 2022 https://github.com/python/cpython/pull/98001/commits/082625cafdbd6ae0bddb5054e0405a7e4530e67b
c50ff36 find last loc in finally body iritkatriel Oct 6, 2022 https://github.com/python/cpython/pull/98001/commits/c50ff3632f2967865c2070f60c00c466b8c75bd7
091266f remove scaffold iritkatriel Oct 6, 2022 https://github.com/python/cpython/pull/98001/commits/091266fde3010ba3394ec46fb0d0c6e67dba1e06
8fd667d remove u_loc from compiler_unit iritkatriel Oct 6, 2022 https://github.com/python/cpython/pull/98001/commits/8fd667dc07da435f67b0571074766a91eb9042ba
c7764ce Merge remote-tracking branch 'upstream/main' into linenos iritkatriel Oct 6, 2022 https://github.com/python/cpython/pull/98001/commits/c7764cedcfa8964290651d97d68f9145c458dd5b
498e98b Merge remote-tracking branch 'upstream/main' into linenos iritkatriel Oct 7, 2022 https://github.com/python/cpython/pull/98001/commits/498e98bc69da0f60820269fa930284c1e7440dfe
f8d061b Merge branch 'main' into linenos JelleZijlstra Oct 7, 2022 https://github.com/python/cpython/pull/98001/commits/f8d061b373f3b84397467a4595e98697693a00ab
0df1e0c typedef of the location struct iritkatriel Oct 7, 2022 https://github.com/python/cpython/pull/98001/commits/0df1e0cd31b1a481ff5211e2dc04eb21a7eaaa7a
e09f741 Merge branch 'main' into linenos iritkatriel Oct 8, 2022 https://github.com/python/cpython/pull/98001/commits/e09f741167d997ef9433136adb7c7d3261e47e43
80393a3 Merge branch 'main' into linenos iritkatriel Oct 16, 2022 https://github.com/python/cpython/pull/98001/commits/80393a395b31e4f66444a398de6e0ecef7423826
8e7acf6 int --> Py_ssize_t. renamed last_location_in_body --> location_of_las… iritkatriel Oct 17, 2022 https://github.com/python/cpython/pull/98001/commits/8e7acf65999539a9a190e72ca4afb9b0afa0e559
5418bb5 removed CHANGED comment indicating where line numbers were not perfec… iritkatriel Oct 17, 2022 https://github.com/python/cpython/pull/98001/commits/5418bb535fa0b28e966ca38bb2d0b48d0c132ccb
Clear filters https://github.com/python/cpython/pull/98001/files
Please reload this pagehttps://github.com/python/cpython/pull/98001/files
Please reload this pagehttps://github.com/python/cpython/pull/98001/files
Please reload this pagehttps://github.com/python/cpython/pull/98001/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.