René's URL Explorer Experiment


Title: Revert __signature__ to being a cache, remove string and callable support · Issue #116110 · python/cpython · GitHub

Open Graph Title: Revert __signature__ to being a cache, remove string and callable support · Issue #116110 · python/cpython

X Title: Revert __signature__ to being a cache, remove string and callable support · Issue #116110 · python/cpython

Description: Feature or enhancement Proposal: #100039 modified the behavior of __signature__ as used by the inspect.signature function : if the fields contains a Signature object, it is returned by the function (that doesn't change) if it contains No...

Open Graph Description: Feature or enhancement Proposal: #100039 modified the behavior of __signature__ as used by the inspect.signature function : if the fields contains a Signature object, it is returned by the function...

X Description: Feature or enhancement Proposal: #100039 modified the behavior of __signature__ as used by the inspect.signature function : if the fields contains a Signature object, it is returned by the function...

Opengraph URL: https://github.com/python/cpython/issues/116110

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Revert  __signature__ to being a cache, remove string and callable support","articleBody":"# Feature or enhancement\r\n\r\n### Proposal:\r\n\r\n#100039 modified the behavior of `__signature__` as used by the inspect.signature function :\r\n- if the fields contains a Signature object, it is returned by the function (that doesn't change)\r\n- if it contains None, it is ignored (that doesn't change)\r\n- if it contains a string, it is converted to a signature (new)\r\n- if it contains a callable, it is called with no parameters and expected to return either a signature object or a string which will be treated as the above (new)\r\n- if it contains any other value, a TypeError is raised (this used to include strings and callables, it doesn't anymore)\r\n\r\n**As for strings :**\r\nThe `__text_signature__` attribute's purpose is to pass a string to inform the signature. It's also only used for C-written functions, and iirc there's no way to use it in pure python : I understand that, but if the ability to specify a text override of inspect.signature must happen, then it should go through `__text_signature__` and not `__signature__`.\r\n\r\n**As for callables :**\r\nThe Signature object qualifies, and the signature function inspects, callables. So, if when asked for the signature of a given callable you return another callable, it would make more sense to consider the second callable's signature as the signature of the first callable, than considering the second callable to _return_ the signature of the first. And why no parameters ? Why not pass the first callable as parameter ? Or the actual signature of the first callable ? That implementation raises a lot of questions of arbitrariness, which makes it a bad design in my opinion.\r\n\r\n**As for the purpose :**\r\nThe use case, which was adding signature overrides to Enums, does not require any change to the inspect module, in fact a perfectly good alternative implementation can be found in #115937. It should also make for a considerably faster execution.\r\n\r\nI suggest reverting these changes.\r\n\r\n### Links to previous discussion of this feature:\r\n\r\nThis was discussed in #115937 and #116086 in which it was advised to separate the question of the implementation from that of the documentation.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-116234\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Gouvernathor","@type":"Person","name":"Gouvernathor"},"datePublished":"2024-02-29T10:49:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/116110/cpython/issues/116110"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0cb9e568-a87f-ad03-5143-95e80c2eec99
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB7E6:D741D:AF2A4:F0455:696962BB
html-safe-noncea483ef017e42fd75a62f8635f6ddc3e3b749ffe0a1982fcb2942cb45b5e813e8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0U2OkQ3NDFEOkFGMkE0OkYwNDU1OjY5Njk2MkJCIiwidmlzaXRvcl9pZCI6Ijc5MjU5MTE5MjEwMzE1MDI2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4369a80a074b0d15ec3c5231b503757248ce822a7245dd0b5a769a00e65f3395
hovercard-subject-tagissue:2160963684
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/116110/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ca4d0b41611cd45da3ef48cd865023275bc0ce2929c1f92cf8aecb026d4bcffc/python/cpython/issues/116110
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ca4d0b41611cd45da3ef48cd865023275bc0ce2929c1f92cf8aecb026d4bcffc/python/cpython/issues/116110
og:image:altFeature or enhancement Proposal: #100039 modified the behavior of __signature__ as used by the inspect.signature function : if the fields contains a Signature object, it is returned by the function...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameGouvernathor
hostnamegithub.com
expected-hostnamegithub.com
None48487c1ad776a7975b7132d95f4240ff3ae37cd5b8e3cb597102a4edb76738f1
turbo-cache-controlno-preview
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-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release669463fcc54773a88c1f5a44eef6b99a5504b9c7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/116110#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F116110
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%2Fissues%2F116110
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/116110
Reloadhttps://github.com/python/cpython/issues/116110
Reloadhttps://github.com/python/cpython/issues/116110
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/116110
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/issues/116110
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
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/116110
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/116110
Revert __signature__ to being a cache, remove string and callable supporthttps://github.com/python/cpython/issues/116110#top
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/Gouvernathor
https://github.com/Gouvernathor
Gouvernathorhttps://github.com/Gouvernathor
on Feb 29, 2024https://github.com/python/cpython/issues/116110#issue-2160963684
#100039https://github.com/python/cpython/issues/100039
#115937https://github.com/python/cpython/issues/115937
#115937https://github.com/python/cpython/issues/115937
#116086https://github.com/python/cpython/pull/116086
gh-116110: remove extra processing for the __signature__ attribute #116234https://github.com/python/cpython/pull/116234
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
Inspect issues 🔍https://github.com/orgs/python/projects/45
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.