René's URL Explorer Experiment


Title: `property` assumes that its subclasses have __dict__ · Issue #98963 · python/cpython · GitHub

Open Graph Title: `property` assumes that its subclasses have __dict__ · Issue #98963 · python/cpython

X Title: `property` assumes that its subclasses have __dict__ · Issue #98963 · python/cpython

Description: property's tp_init has this code: if (Py_IS_TYPE(self, &PyProperty_Type)) { Py_XSETREF(self->prop_doc, prop_doc); } else { /* If this is a property subclass, put __doc__ in dict of the subclass instance instead, otherwise it gets shadowe...

Open Graph Description: property's tp_init has this code: if (Py_IS_TYPE(self, &PyProperty_Type)) { Py_XSETREF(self->prop_doc, prop_doc); } else { /* If this is a property subclass, put __doc__ in dict of the subclass ins...

X Description: property's tp_init has this code: if (Py_IS_TYPE(self, &PyProperty_Type)) { Py_XSETREF(self->prop_doc, prop_doc); } else { /* If this is a property subclass, put __doc__ in dict of the s...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`property` assumes that its subclasses have __dict__","articleBody":"`property`'s `tp_init` has [this code](https://github.com/python/cpython/blob/f042646595d1cdd2ecdc15222b1766f746d010f0/Objects/descrobject.c#L1813-L1832):\r\n\r\n```\r\n    if (Py_IS_TYPE(self, \u0026PyProperty_Type)) {\r\n        Py_XSETREF(self-\u003eprop_doc, prop_doc);\r\n    } else {\r\n        /* If this is a property subclass, put __doc__\r\n           in dict of the subclass instance instead,\r\n           otherwise it gets shadowed by __doc__ in the\r\n           class's dict. */\r\n\r\n        /*...*/\r\n         PyObject_SetAttr((PyObject *)self, \u0026_Py_ID(__doc__), prop_doc);\r\n        /*...*/\r\n    }\r\n```\r\n\r\nThis assumes that subclasses of `property` have a `__dict__` (or a `__doc__` attribute settable by other means). That is the case when subclassed using the `class` statement, but might not be true using C.\r\nA C-API reproducer is at https://github.com/wjakob/inheritance_issue/blob/master/inheritance_issue.c\r\n\r\nI don't see a good way to fix this. We could:\r\n- document that subclasses need to set `Py_TPFLAGS_MANAGED_DICT` (or provide a `__doc__` descriptor), or \r\n- ignore the `AttributeError`, unless `__doc__` was set explicitly?\n\n\u003c!-- gh-pr-number: gh-99058 --\u003e\n* PR: gh-99058\n\u003c!-- /gh-pr-number --\u003e\n\n\n\u003c!-- gh-pr-number: gh-105262 --\u003e\n* PR: gh-105262\n\u003c!-- /gh-pr-number --\u003e\n\n\n\u003c!-- gh-pr-number: gh-105297 --\u003e\n* PR: gh-105297\n\u003c!-- /gh-pr-number --\u003e\n","author":{"url":"https://github.com/encukou","@type":"Person","name":"encukou"},"datePublished":"2022-11-01T14:43:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/98963/cpython/issues/98963"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9a94e77b-481c-b702-2411-a88f6a015873
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB816:15FF28:14DDDBC:1D4007C:696A4108
html-safe-noncee1f88b1ad9cdf6a39f61ba2c8c7e47c2de1ec38df9607fc9ccafa076367898a4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODE2OjE1RkYyODoxNEREREJDOjFENDAwN0M6Njk2QTQxMDgiLCJ2aXNpdG9yX2lkIjoiNTQyOTgzMTUwMTQzNzYxNjM5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacedcb2fa07244ebbcf73893c050b81efd0e34730058058d5a819c58c5f061779c
hovercard-subject-tagissue:1431547618
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/98963/issue_layout
twitter:imagehttps://opengraph.githubassets.com/816372f87a6b35316b163a8fd3569db8a4b63f3e07802a5a8a7e870c6aaa8614/python/cpython/issues/98963
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/816372f87a6b35316b163a8fd3569db8a4b63f3e07802a5a8a7e870c6aaa8614/python/cpython/issues/98963
og:image:altproperty's tp_init has this code: if (Py_IS_TYPE(self, &PyProperty_Type)) { Py_XSETREF(self->prop_doc, prop_doc); } else { /* If this is a property subclass, put __doc__ in dict of the subclass ins...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameencukou
hostnamegithub.com
expected-hostnamegithub.com
None321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538
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
release13581a31d51edf4a3aca179e10890a4d4f9b6d76
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/98963#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F98963
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%2F98963
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/98963
Reloadhttps://github.com/python/cpython/issues/98963
Reloadhttps://github.com/python/cpython/issues/98963
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/98963
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/98963
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/98963
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/98963
property assumes that its subclasses have __dict__https://github.com/python/cpython/issues/98963#top
https://github.com/gpshead
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/encukou
https://github.com/encukou
encukouhttps://github.com/encukou
on Nov 1, 2022https://github.com/python/cpython/issues/98963#issue-1431547618
this codehttps://github.com/python/cpython/blob/f042646595d1cdd2ecdc15222b1766f746d010f0/Objects/descrobject.c#L1813-L1832
https://github.com/wjakob/inheritance_issue/blob/master/inheritance_issue.chttps://github.com/wjakob/inheritance_issue/blob/master/inheritance_issue.c
gh-98963: Add a note to the error for property subclasses without __doc__ #99058https://github.com/python/cpython/pull/99058
gh-98963: Restore the ability to have a dict-less property. #105262https://github.com/python/cpython/pull/105262
[3.12] gh-98963: Restore the ability to have a dict-less property. (GH-105262) #105297https://github.com/python/cpython/pull/105297
gpsheadhttps://github.com/gpshead
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.