René's URL Explorer Experiment


Title: Add a Dataclass abstract base class for instance checking and type annotations · Issue #102699 · python/cpython · GitHub

Open Graph Title: Add a Dataclass abstract base class for instance checking and type annotations · Issue #102699 · python/cpython

X Title: Add a Dataclass abstract base class for instance checking and type annotations · Issue #102699 · python/cpython

Description: Feature or enhancement Add the class dataclasses.Dataclass that supports instance and subclass checks using similar logic as dataclasses.is_dataclass, and blocks inheritance in __init_subclass__. (Edit: removed "has an attribute __datacl...

Open Graph Description: Feature or enhancement Add the class dataclasses.Dataclass that supports instance and subclass checks using similar logic as dataclasses.is_dataclass, and blocks inheritance in __init_subclass__. (...

X Description: Feature or enhancement Add the class dataclasses.Dataclass that supports instance and subclass checks using similar logic as dataclasses.is_dataclass, and blocks inheritance in __init_subclass__. (...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a Dataclass abstract base class for instance checking and type annotations","articleBody":"# Feature or enhancement\r\n\r\nAdd the class `dataclasses.Dataclass` that\r\n- supports instance and subclass checks using similar logic as `dataclasses.is_dataclass`, and\r\n- blocks inheritance in `__init_subclass__`.\r\n\r\n(Edit: removed \"has an attribute `__dataclass_fields__` for the purpose of type checking\")\r\n\r\n# Pitch\r\n\r\nThis class would simplify runtime type-checking of dataclasses:\r\n```python\r\nnot isinstance(x, type) and dataclasses.is_dataclass(x)  # Previously\r\nisinstance(x, dataclasses.Dataclass)  # With this feature.\r\n```\r\nand similarly\r\n```python\r\nisinstance(x, type) and dataclasses.is_dataclass(x)  # Previously.\r\nissubclass(x, dataclasses.Dataclass)  # With this feature.\r\n```\r\nBesides being simpler, it would also allow combined instance checks like `isinstance(x, Dataclass | SomeOtherBase)`, which is arguably more Pythonic than the combined function calls above (marked \"Previously\").\r\n\r\nIt would also allow users to annotate dataclasses using `Dataclass` or `type[Dataclass]`, which is currently impossible without reaching into protected areas of the typeshed.\r\n\r\nInheritance could be blocked for now with a friendly error message (that perhaps tells you to use the decorator either directly or in a base class's `__init_subclass__`).\r\n\r\n# Previous discussion\r\n\r\nThere's some discussion here: https://github.com/python/typing_extensions/issues/115\r\n@AlexWaygood \r\n@JelleZijlstra \r\n@henryiii \n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-102933\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/NeilGirdhar","@type":"Person","name":"NeilGirdhar"},"datePublished":"2023-03-14T20:03:22Z","url":"https://github.com/python/cpython/issues/102699"}

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:ae93dbc9-2132-eb75-4770-dd431f4e039c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBFEC:7B930:65EA9C:8B5808:6B0077B1
html-safe-nonceb71fc3a458f29779f6d3cf12a4262021c4666cfb52fee4254fca85968fcf07dd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkVDOjdCOTMwOjY1RUE5Qzo4QjU4MDg6NkIwMDc3QjEiLCJ2aXNpdG9yX2lkIjoiODQ3MjQyMTY2MDA1NjY0NzYwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc4aaacfa4a7fee03edb5a3cf3189fc9c4522e06d1c47a314d062cee13b1a4f80
hovercard-subject-tagissue:1624215692
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/102699/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8acc02b2b14a24739bfbef2fcf4dc882d172795ed1d2c46743a319a09be3607e/python/cpython/issues/102699
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8acc02b2b14a24739bfbef2fcf4dc882d172795ed1d2c46743a319a09be3607e/python/cpython/issues/102699
og:image:altFeature or enhancement Add the class dataclasses.Dataclass that supports instance and subclass checks using similar logic as dataclasses.is_dataclass, and blocks inheritance in __init_subclass__. (...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameNeilGirdhar
hostnamegithub.com
expected-hostnamegithub.com
None75c2b65dd205f26961d0c29afed1a8d0bb7cca9f05780571dfd1ef93eb539d16
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
release84e563eb4b55f8fa102f325f117533cee9e3df4a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/102699#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F102699
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%2Fcpython%2Fissues%2F102699
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%2Fcpython
Reloadhttps://github.com/python/cpython/issues/102699
Reloadhttps://github.com/python/cpython/issues/102699
Reloadhttps://github.com/python/cpython/issues/102699
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/102699
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/102699
Add a Dataclass abstract base class for instance checking and type annotationshttps://github.com/python/cpython/issues/102699#top
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-dataclasseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-dataclasses%22
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/NeilGirdhar
NeilGirdharhttps://github.com/NeilGirdhar
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issue-1624215692
python/typing_extensions#115https://github.com/python/typing_extensions/issues/115
@AlexWaygoodhttps://github.com/AlexWaygood
@JelleZijlstrahttps://github.com/JelleZijlstra
@henryiiihttps://github.com/henryiii
gh-102699: Add dataclasses.DataclassLike #102933https://github.com/python/cpython/pull/102933
NeilGirdharhttps://github.com/NeilGirdhar
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
on Mar 14, 2023https://github.com/python/cpython/issues/102699#event-8748033281
AlexWaygoodhttps://github.com/AlexWaygood
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
on Mar 14, 2023https://github.com/python/cpython/issues/102699#event-8748069818
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 14, 2023https://github.com/python/cpython/issues/102699#event-8748162781
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468792077
recently changedhttps://github.com/python/typeshed/pull/9362
a DataclassInstance protocolhttps://github.com/python/typeshed/blob/c9fa41683a9d38aba1774394f18ed69b5bae6e57/stdlib/_typeshed/__init__.pyi#L313-L314
dataclasses.asdicthttps://github.com/python/typeshed/blob/c9fa41683a9d38aba1774394f18ed69b5bae6e57/stdlib/dataclasses.pyi#L49-L52
dataclasses.astuplehttps://github.com/python/typeshed/blob/c9fa41683a9d38aba1774394f18ed69b5bae6e57/stdlib/dataclasses.pyi#L53-L56
dataclasses.replacehttps://github.com/python/typeshed/blob/c9fa41683a9d38aba1774394f18ed69b5bae6e57/stdlib/dataclasses.pyi#L302
dataclass_transformhttps://peps.python.org/pep-0681/
@ericvsmithhttps://github.com/ericvsmith
@carljmhttps://github.com/carljm
https://github.com/NeilGirdhar
NeilGirdharhttps://github.com/NeilGirdhar
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468830976
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468834382
https://github.com/carljm
carljmhttps://github.com/carljm
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468862273
@ericvsmithhttps://github.com/ericvsmith
https://github.com/NeilGirdhar
NeilGirdharhttps://github.com/NeilGirdhar
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468875331
my discussionhttps://github.com/python-attrs/attrs/issues/640
https://github.com/carljm
carljmhttps://github.com/carljm
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468889979
https://github.com/NeilGirdhar
NeilGirdharhttps://github.com/NeilGirdhar
on Mar 14, 2023https://github.com/python/cpython/issues/102699#issuecomment-1468908014
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
on Mar 15, 2023https://github.com/python/cpython/issues/102699#issuecomment-1469648645
https://docs.python.org/3/library/dataclasses.htmlhttps://docs.python.org/3/library/dataclasses.html
https://github.com/NeilGirdhar
NeilGirdharhttps://github.com/NeilGirdhar
on Mar 15, 2023https://github.com/python/cpython/issues/102699#issuecomment-1469657870
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 15, 2023https://github.com/python/cpython/issues/102699#issuecomment-1470285409
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 22, 2023https://github.com/python/cpython/issues/102699#event-8821239206
pythongh-102699: Add `dataclasses.DataclassLike`https://github.com/AlexWaygood/cpython/commit/e6bf11877feeb7b1fbb372f5c4961ea08b493912
pythongh-102699https://github.com/python/cpython/issues/102699
e6bf118https://github.com/AlexWaygood/cpython/commit/e6bf11877feeb7b1fbb372f5c4961ea08b493912
pythongh-102699: Add `dataclasses.DataclassLike`https://github.com/AlexWaygood/cpython/commit/f2c96a468c314b4b02d46dfc1e348b642ec8806f
pythongh-102699https://github.com/python/cpython/issues/102699
f2c96a4https://github.com/AlexWaygood/cpython/commit/f2c96a468c314b4b02d46dfc1e348b642ec8806f
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 22, 2023https://github.com/python/cpython/issues/102699#issuecomment-1480285586
gh-102699: Add dataclasses.DataclassLike #102933https://github.com/python/cpython/pull/102933
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
on May 10, 2023https://github.com/python/cpython/issues/102699#issuecomment-1542723383
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on May 12, 2023https://github.com/python/cpython/issues/102699#issuecomment-1546110236
the @dataclass_transform decoratorhttps://peps.python.org/pep-0681/
unexpected performance issueshttps://github.com/python/cpython/issues/74690
https://github.com/antonagestam
antonagestamhttps://github.com/antonagestam
on Oct 3, 2023https://github.com/python/cpython/issues/102699#issuecomment-1745835799
https://github.com/antonagestam
antonagestamhttps://github.com/antonagestam
on Oct 3, 2023https://github.com/python/cpython/issues/102699#issuecomment-1745838195
erlend-aaslandhttps://github.com/erlend-aasland
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
on Jan 5, 2024https://github.com/python/cpython/issues/102699#event-11399787653
picnixzhttps://github.com/picnixz
topic-dataclasseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-dataclasses%22
on Aug 16, 2024https://github.com/python/cpython/issues/102699#event-13908203395
erlend-aaslandhttps://github.com/erlend-aasland
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
on Apr 17, 2025https://github.com/python/cpython/issues/102699#event-17312502111
https://github.com/NeilGirdhar
NeilGirdharhttps://github.com/NeilGirdhar
on May 18, 2026https://github.com/python/cpython/issues/102699#issuecomment-4473890582
NeilGirdharhttps://github.com/NeilGirdhar
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 18, 2026https://github.com/python/cpython/issues/102699#event-25638843733
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/102699
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/102699
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-dataclasseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-dataclasses%22
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%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.