René's URL Explorer Experiment


Title: Conformance suite: Questionable tests in dataclasses_descriptors.py · Issue #2259 · python/typing · GitHub

Open Graph Title: Conformance suite: Questionable tests in dataclasses_descriptors.py · Issue #2259 · python/typing

X Title: Conformance suite: Questionable tests in dataclasses_descriptors.py · Issue #2259 · python/typing

Description: The dataclasses_descriptors.py test case has a comment "This portion of the dataclass spec is under-specified in the documentation, but its behavior can be determined from the runtime implementation." However, some of the behaviors in te...

Open Graph Description: The dataclasses_descriptors.py test case has a comment "This portion of the dataclass spec is under-specified in the documentation, but its behavior can be determined from the runtime implementatio...

X Description: The dataclasses_descriptors.py test case has a comment "This portion of the dataclass spec is under-specified in the documentation, but its behavior can be determined from the runtime implemen...

Opengraph URL: https://github.com/python/typing/issues/2259

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Conformance suite: Questionable tests in dataclasses_descriptors.py","articleBody":"The [dataclasses_descriptors.py](https://github.com/python/typing/blob/main/conformance/tests/dataclasses_descriptors.py) test case has a comment \"This portion of the dataclass spec is under-specified in the documentation, but its behavior can be determined from the runtime implementation.\"\nHowever, some of the behaviors in tests don't align with the runtime behavior.\n\nThe first part, which is using a data descriptor `Desc1` and a dataclass `DC1`, is fine.\n\nThen we get this, where `Desc2` is a non-data descriptor (only implementing `__get__`):\n\n```python\n@dataclass\nclass DC2:\n    x: Desc2[int]\n    y: Desc2[str]\n    z: Desc2[str] = Desc2()\n\n\nassert_type(DC2.x, list[int])\nassert_type(DC2.y, list[str])\nassert_type(DC2.z, list[str])\n```\n\nHowever, `DC2.x` and `DC2.y` are AttributeErrors at runtime, because there is no `Desc2` object in the runtime class dictionary. I don't know if we should require type checkers to produce an error but certainly we should allow it.\n\nThen we construct a `DC2` object:\n\n```python\n\ndc2 = DC2(Desc2(), Desc2(), Desc2())\nassert_type(dc2.x, int)\nassert_type(dc2.y, str)\nassert_type(dc2.z, str)\n```\n\nBut at runtime, `dc2`'s three attributes are all just those `Desc2` objects, not ints or strs, because those objects are stored as instance attributes, so the descriptor protocol never runs on them.\n\nThe more complicated case is the `z` attribute, which has a `Desc2` object stored in the class. Dataclasses would conventionally treat this as the default, but it gets the default by conventional access in the class body, which calls the descriptor's `__get__` with obj=None. So the runtime default for this field is actually the value you'd get for accessing `DC2.z`, which is `list[str]`.\n\nLooking at actual type checker behavior, I think pyrefly gets all this pretty much right (which means it fails the test). Mypy and pyright pass the test, but their behavior is wrong.\n\nSince (as the test acknowledges) the behavior is not fully specified, perhaps it is best to delete this test from the conformance suite for now, until we come up with a full specification for the behavior of descriptors in dataclasses.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2026-04-14T02:36:35Z","url":"https://github.com/python/typing/issues/2259"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7e599b22-4eff-b331-8281-92f6923ac716
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC526:3F7946:674B73:8B6F22:6AFF8C81
html-safe-nonce658d821129b746ddae0be9129b5b5999135a7e1a1e75094ffaaea6be5967651b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTI2OjNGNzk0Njo2NzRCNzM6OEI2RjIyOjZBRkY4QzgxIiwidmlzaXRvcl9pZCI6IjY5MTcyODU3NDk2MDM2NjcwNzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac79bc2312ad5d43c8e119cd9e0d73ab6d00098179a08e988d93d27c6c76828a36
hovercard-subject-tagissue:4259122341
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/typing/2259/issue_layout
twitter:imagehttps://opengraph.githubassets.com/64941c0973497f31e43bb2612f91c8b2be03e614c9f2cef6419b2b79df25c148/python/typing/issues/2259
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/64941c0973497f31e43bb2612f91c8b2be03e614c9f2cef6419b2b79df25c148/python/typing/issues/2259
og:image:altThe dataclasses_descriptors.py test case has a comment "This portion of the dataclass spec is under-specified in the documentation, but its behavior can be determined from the runtime implementatio...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJelleZijlstra
hostnamegithub.com
expected-hostnamegithub.com
None587ad99a3e443b2e1cb0d3df059ec49ab54389861f13310766dfdeb615fed90d
turbo-cache-controlno-preview
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
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
release5bb0fb68d64881d1344f5863d809515d496801e5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/2259#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F2259
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F2259
Sign uphttps://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%2Ftyping
Reloadhttps://github.com/python/typing/issues/2259
Reloadhttps://github.com/python/typing/issues/2259
Reloadhttps://github.com/python/typing/issues/2259
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
https://github.com/python/typing
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/2259
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/2259
#2299https://github.com/python/typing/pull/2299
Conformance suite: Questionable tests in dataclasses_descriptors.pyhttps://github.com/python/typing/issues/2259#top
#2299https://github.com/python/typing/pull/2299
topic: conformance testsIssues with the conformance test suitehttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20conformance%20tests%22
topic: otherOther topics not coveredhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20other%22
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Apr 14, 2026https://github.com/python/typing/issues/2259#issue-4259122341
dataclasses_descriptors.pyhttps://github.com/python/typing/blob/main/conformance/tests/dataclasses_descriptors.py
JelleZijlstrahttps://github.com/JelleZijlstra
topic: otherOther topics not coveredhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20other%22
topic: conformance testsIssues with the conformance test suitehttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20conformance%20tests%22
on Apr 14, 2026https://github.com/python/typing/issues/2259#event-24470171086
https://github.com/ashishpatel26
ashishpatel26https://github.com/ashishpatel26
on Jul 10, 2026https://github.com/python/typing/issues/2259#issuecomment-4933036013
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/2259
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/2259
topic: conformance testsIssues with the conformance test suitehttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20conformance%20tests%22
topic: otherOther topics not coveredhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20other%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.