René's URL Explorer Experiment


Title: bpo-33211: Add def_lineno and class_lineno attributes to FunctionDef and ClassDef by emmatyping · Pull Request #6410 · python/cpython · GitHub

Open Graph Title: bpo-33211: Add def_lineno and class_lineno attributes to FunctionDef and ClassDef by emmatyping · Pull Request #6410 · python/cpython

X Title: bpo-33211: Add def_lineno and class_lineno attributes to FunctionDef and ClassDef by emmatyping · Pull Request #6410 · python/cpython

Description: As reported in the bug, a decorated function or class like below will report the first line of the decorator as its line number (so the FunctionDef.lineno will be 1). @decorate( "multi", "line" ) def foo( a, b, ): pass This change adds a def_lineno for functions and class_lineno for classes. These attributes report the real line numbers of the beginning of the function or class definition. This is especially valuable for linters and tools parsing Python. I wasn't sure where to put something in the docs since the ast docs are sparse. This isn't quite ready yet, I need to figure out what changes I need to make to the unparser (which I will do tomorrow). https://bugs.python.org/issue33211

Open Graph Description: As reported in the bug, a decorated function or class like below will report the first line of the decorator as its line number (so the FunctionDef.lineno will be 1). @decorate( "multi...

X Description: As reported in the bug, a decorated function or class like below will report the first line of the decorator as its line number (so the FunctionDef.lineno will be 1). @decorate( "m...

Opengraph URL: https://github.com/python/cpython/pull/6410

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4e6f7a57-310a-ce0f-da50-f884f2ccf2c8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD2E4:52373:C1B6E5:107B540:6A55B3D3
html-safe-nonceab49d4fefc91271a00e539861fb9f9625571105bd5a14fb3ea6190f3990c24d4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkU0OjUyMzczOkMxQjZFNToxMDdCNTQwOjZBNTVCM0QzIiwidmlzaXRvcl9pZCI6IjY1MjEwMDcxODYxMTgwMzAyOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9c58f42510fa10161e3014f0b0c48184a03379fd1423401fefd689a3eb90b1f5
hovercard-subject-tagpull_request:180103054
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/6410/files
twitter:imagehttps://avatars.githubusercontent.com/u/9504279?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9504279?s=400&v=4
og:image:altAs reported in the bug, a decorated function or class like below will report the first line of the decorator as its line number (so the FunctionDef.lineno will be 1). @decorate( "multi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release653fccf1e27344851c0d3de3fa6faa526197f072
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/6410/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F6410%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F6410%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/6410/files
Reloadhttps://github.com/python/cpython/pull/6410/files
Reloadhttps://github.com/python/cpython/pull/6410/files
Please reload this pagehttps://github.com/python/cpython/pull/6410/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/6410/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
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 and quality 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
emmatypinghttps://github.com/emmatyping
python:masterhttps://github.com/python/cpython/tree/master
emmatyping:decorlinenohttps://github.com/emmatyping/cpython/tree/decorlineno
Conversation 1 https://github.com/python/cpython/pull/6410
Commits 5 https://github.com/python/cpython/pull/6410/commits
Checks 0 https://github.com/python/cpython/pull/6410/checks
Files changed https://github.com/python/cpython/pull/6410/files
Please reload this pagehttps://github.com/python/cpython/pull/6410/files
bpo-33211: Add def_lineno and class_lineno attributes to FunctionDef and ClassDef https://github.com/python/cpython/pull/6410/files#top
Show all changes 5 commits https://github.com/python/cpython/pull/6410/files
d77cdcc Add decorated_lineno to func and class ast nodes emmatyping Apr 5, 2018 https://github.com/python/cpython/pull/6410/commits/d77cdccd92e61200e782d6f154258997236c6e61
8c8745f Change names to be more specific and clearer emmatyping Apr 6, 2018 https://github.com/python/cpython/pull/6410/commits/8c8745fbd7935b429829807807a78379ea627067
ae2a76e Reorder arguments to decorated, add and fix tests emmatyping Apr 7, 2018 https://github.com/python/cpython/pull/6410/commits/ae2a76e0c8cfb39f49531e2028c47c9bbaaf084e
0fd1780 Merge master into origin/decorlineno emmatyping Apr 7, 2018 https://github.com/python/cpython/pull/6410/commits/0fd1780840f9618be71d98b551d3315e4ac81d8f
471264b Fix type and remove debug code emmatyping Apr 7, 2018 https://github.com/python/cpython/pull/6410/commits/471264ba37c5931a80aa4f27cc96e9e7718a81a5
Clear filters https://github.com/python/cpython/pull/6410/files
Please reload this pagehttps://github.com/python/cpython/pull/6410/files
Please reload this pagehttps://github.com/python/cpython/pull/6410/files
Python-ast.h https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
test_ast.py https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
2018-04-07-04-39-38.bpo-33211.HCBE2_.rst https://github.com/python/cpython/pull/6410/files#diff-80648d421ee38daf70852384a7c5c9b64b14fb60b7e9506066839cd8c41be845
Python.asdl https://github.com/python/cpython/pull/6410/files#diff-56cfb21eb86b07bb94e916eb74143c7d6c2ac6f2494216c0e2507fd080c34aed
Python-ast.c https://github.com/python/cpython/pull/6410/files#diff-0258ad568d1bc0a5fa1c949351df0cc72a0a63441a1ed78c77d59f5695704857
ast.c https://github.com/python/cpython/pull/6410/files#diff-63309d32b22eaebd869b7ac0d2d4d02f95bd7ff5de2ba042d07c8e6962af8bbc
importlib.h https://github.com/python/cpython/pull/6410/files#diff-f22c3fe718474bf1830c047f516ef95818493a9a9fcf8f2d5b159b1b5b76ecd6
importlib_external.h https://github.com/python/cpython/pull/6410/files#diff-edaa85591e6f559d0fae8073b45dc3e9c8e251053d07623b2ce23392dfe97a7e
Include/Python-ast.hhttps://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
View file https://github.com/emmatyping/cpython/blob/471264ba37c5931a80aa4f27cc96e9e7718a81a5/Include/Python-ast.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6410/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
https://github.com/python/cpython/pull/6410/files#diff-aa47c9a4ecdd799c2932afef25673bf9c33ec9ef75f1bc6054b924bea602c747
Lib/test/test_ast.pyhttps://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
View file https://github.com/emmatyping/cpython/blob/471264ba37c5931a80aa4f27cc96e9e7718a81a5/Lib/test/test_ast.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6410/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/6410/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
Misc/NEWS.d/next/Core and Builtins/2018-04-07-04-39-38.bpo-33211.HCBE2_.rsthttps://github.com/python/cpython/pull/6410/files#diff-80648d421ee38daf70852384a7c5c9b64b14fb60b7e9506066839cd8c41be845
View file https://github.com/emmatyping/cpython/blob/471264ba37c5931a80aa4f27cc96e9e7718a81a5/Misc/NEWS.d/next/Core%20and%20Builtins/2018-04-07-04-39-38.bpo-33211.HCBE2_.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6410/{{ revealButtonHref }}
Parser/Python.asdlhttps://github.com/python/cpython/pull/6410/files#diff-56cfb21eb86b07bb94e916eb74143c7d6c2ac6f2494216c0e2507fd080c34aed
View file https://github.com/emmatyping/cpython/blob/471264ba37c5931a80aa4f27cc96e9e7718a81a5/Parser/Python.asdl
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6410/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6410/files#diff-56cfb21eb86b07bb94e916eb74143c7d6c2ac6f2494216c0e2507fd080c34aed
https://github.com/python/cpython/pull/6410/files#diff-56cfb21eb86b07bb94e916eb74143c7d6c2ac6f2494216c0e2507fd080c34aed
Please reload this pagehttps://github.com/python/cpython/pull/6410/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.