René's URL Explorer Experiment


Title: Annotation-based syntax for ctypes structs · Issue #104533 · python/cpython · GitHub

Open Graph Title: Annotation-based syntax for ctypes structs · Issue #104533 · python/cpython

X Title: Annotation-based syntax for ctypes structs · Issue #104533 · python/cpython

Description: Turn this: class S(ctypes.Structure): _fields_ = [ ('a', ctypes.c_int), ('b', ctypes.c_char_p) ] Into this: class S(ctypes.Structure): a : ctypes.c_int b : ctypes.c_char_p See discussion on https://discuss.python.org/t/annotation-based-s...

Open Graph Description: Turn this: class S(ctypes.Structure): _fields_ = [ ('a', ctypes.c_int), ('b', ctypes.c_char_p) ] Into this: class S(ctypes.Structure): a : ctypes.c_int b : ctypes.c_char_p See discussion on https:/...

X Description: Turn this: class S(ctypes.Structure): _fields_ = [ ('a', ctypes.c_int), ('b', ctypes.c_char_p) ] Into this: class S(ctypes.Structure): a : ctypes.c_int b : ctypes.c_char_p See discu...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Annotation-based syntax for ctypes structs","articleBody":"Turn this:\r\n```python\r\nclass S(ctypes.Structure):\r\n   _fields_ = [ ('a', ctypes.c_int), ('b', ctypes.c_char_p) ]\r\n```\r\n\r\nInto this:\r\n```python\r\nclass S(ctypes.Structure):\r\n    a : ctypes.c_int\r\n    b : ctypes.c_char_p\r\n```\r\n\r\nSee discussion on https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579\r\n\r\nWorking on implementation\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-153781\n* gh-154031\n* gh-154038\n* gh-154040\n* gh-154091\n* gh-154169\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/orent","@type":"Person","name":"orent"},"datePublished":"2023-05-16T06:10:03Z","url":"https://github.com/python/cpython/issues/104533"}

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:b63fd4f6-416d-917f-eb90-268622682615
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD6CA:356FBF:254D9CA:328EA71:6B003116
html-safe-nonced52d1022f14eedbe7f7e9779f8130a7d4bd4b1b7c54d340df07ace227d2ae0d9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkNBOjM1NkZCRjoyNTREOUNBOjMyOEVBNzE6NkIwMDMxMTYiLCJ2aXNpdG9yX2lkIjoiNDg4NzE1MzY3NzcxNTkxMDkzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0aefeb7c58e1fcb908d38b0c9b373b28656428425cdc852eaadbbcd65db18876
hovercard-subject-tagissue:1711307146
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/104533/issue_layout
twitter:imagehttps://opengraph.githubassets.com/37b1f1571bad0a6b7e2bab0f45a6a27972a10bdc136c3d9449d5d1845e6bba6a/python/cpython/issues/104533
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/37b1f1571bad0a6b7e2bab0f45a6a27972a10bdc136c3d9449d5d1845e6bba6a/python/cpython/issues/104533
og:image:altTurn this: class S(ctypes.Structure): _fields_ = [ ('a', ctypes.c_int), ('b', ctypes.c_char_p) ] Into this: class S(ctypes.Structure): a : ctypes.c_int b : ctypes.c_char_p See discussion on https:/...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameorent
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/104533#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F104533
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%2F104533
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/104533
Reloadhttps://github.com/python/cpython/issues/104533
Reloadhttps://github.com/python/cpython/issues/104533
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/104533
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/104533
Annotation-based syntax for ctypes structshttps://github.com/python/cpython/issues/104533#top
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/orent
orenthttps://github.com/orent
on May 16, 2023https://github.com/python/cpython/issues/104533#issue-1711307146
https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579
gh-104533: Add a dataclass-like decorator for ctypes structures #153781https://github.com/python/cpython/pull/153781
gh-104533: Use @ctypes.util.struct decorator #154031https://github.com/python/cpython/pull/154031
gh-104533: Fix @ctypes.util.struct with endian #154038https://github.com/python/cpython/pull/154038
gh-104533: Fix @ctypes.util.struct with string annotations #154040https://github.com/python/cpython/pull/154040
gh-104533: Update test_ctypes.test_structures #154091https://github.com/python/cpython/pull/154091
gh-104533: Fix ctypes test_pointer_proto_missing_argtypes_error() #154169https://github.com/python/cpython/pull/154169
Nexthttps://github.com/python/cpython/issues/104533?timeline_page=1
orenthttps://github.com/orent
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
on May 16, 2023https://github.com/python/cpython/issues/104533#event-9253785726
AlexWaygoodhttps://github.com/AlexWaygood
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
on May 16, 2023https://github.com/python/cpython/issues/104533#event-9254621965
https://github.com/zwergziege
zwergziegehttps://github.com/zwergziege
on Jun 18, 2023https://github.com/python/cpython/issues/104533#issuecomment-1596008987
python/typing#629https://github.com/python/typing/issues/629
https://github.com/orent
orenthttps://github.com/orent
on Jun 18, 2023https://github.com/python/cpython/issues/104533#issuecomment-1596085774
https://github.com/junkmd
junkmdhttps://github.com/junkmd
on Aug 13, 2023https://github.com/python/cpython/issues/104533#issuecomment-1676203736
ctypes.wintypes.POINThttps://github.com/python/typeshed/blob/df08fcec5f281ba01266869ec55368819aed0a77/stdlib/ctypes/wintypes.pyi#L126-L128
"there is a need to maintain both syntaxes and make them mutually exclusive"https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579/8
serhiy-storchakahttps://github.com/serhiy-storchaka
Ctypes issueshttps://github.com/orgs/python/projects/42
on Jan 1, 2024https://github.com/python/cpython/issues/104533#event-14877422532
https://github.com/DrInfiniteExplorer
DrInfiniteExplorerhttps://github.com/DrInfiniteExplorer
on Jan 12, 2024https://github.com/python/cpython/issues/104533#issuecomment-1888271397
DrInfiniteExplorer/dtypeshttps://github.com/DrInfiniteExplorer/dtypes
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jun 15, 2024https://github.com/python/cpython/issues/104533#issuecomment-2169842061
https://github.com/encukou
encukouhttps://github.com/encukou
on Jan 20, 2025https://github.com/python/cpython/issues/104533#issuecomment-2601819216
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jan 20, 2025https://github.com/python/cpython/issues/104533#issuecomment-2601899573
PEP-637https://peps.python.org/637
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Jan 20, 2025https://github.com/python/cpython/issues/104533#issuecomment-2602711055
implemented thishttps://github.com/ZeroIntensity/pointers.py/blob/master/src/pointers/structure.py
https://github.com/zwergziege
zwergziegehttps://github.com/zwergziege
on Jan 20, 2025https://github.com/python/cpython/issues/104533#issuecomment-2602754026
https://github.com/y2kbugger
y2kbuggerhttps://github.com/y2kbugger
on Jul 21, 2025https://github.com/python/cpython/issues/104533#issuecomment-3097007060
https://fastapi.tiangolo.com/tutorial/query-params-str-validationshttps://fastapi.tiangolo.com/tutorial/query-params-str-validations
https://discuss.python.org/t/dataclasses-sentinel-to-stop-creating-field-instances/51166/3https://discuss.python.org/t/dataclasses-sentinel-to-stop-creating-field-instances/51166/3
https://github.com/aterray
aterrayhttps://github.com/aterray
on Dec 11, 2025https://github.com/python/cpython/issues/104533#issuecomment-3641627460
https://github.com/0Hughman0
0Hughman0https://github.com/0Hughman0
on Jul 5, 2026https://github.com/python/cpython/issues/104533#issuecomment-4887261646
https://github.com/0Hughman0/c_dll_protocolhttps://github.com/0Hughman0/c_dll_protocol
https://github.com/orent
orenthttps://github.com/orent
on Jul 18, 2026https://github.com/python/cpython/issues/104533#issuecomment-5010786931
https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579
fedonmanhttps://github.com/fedonman
on Jul 18, 2026https://github.com/python/cpython/issues/104533#event-28156044392
pythongh-104533: Add a dataclass-like decorator for `ctypes` structur…https://github.com/fedonman/cpython/commit/df784198414a26acf02817453ee047529e5ad15a
pythongh-104533https://github.com/python/cpython/issues/104533
df78419https://github.com/fedonman/cpython/commit/df784198414a26acf02817453ee047529e5ad15a
picnixzhttps://github.com/picnixz
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Jul 18, 2026https://github.com/python/cpython/issues/104533#event-28156321334
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 18, 2026https://github.com/python/cpython/issues/104533#issuecomment-5010870220
https://github.com/orent
orenthttps://github.com/orent
on Jul 18, 2026https://github.com/python/cpython/issues/104533#issuecomment-5010889278
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 18, 2026https://github.com/python/cpython/issues/104533#issuecomment-5010908354
vstinnerhttps://github.com/vstinner
on Jul 19, 2026https://github.com/python/cpython/issues/104533#event-28169410724
pythongh-104533: Fix @ctypes.util.struct with endianhttps://github.com/vstinner/cpython/commit/6baf15960025872d868077c262cf4358a0b4b4c1
pythongh-104533https://github.com/python/cpython/issues/104533
6baf159https://github.com/vstinner/cpython/commit/6baf15960025872d868077c262cf4358a0b4b4c1
pythongh-104533: Fix @ctypes.util.struct with string annotationshttps://github.com/vstinner/cpython/commit/4f6996119ce840510136b5dad1f473f6d8f2ff83
pythongh-104533https://github.com/python/cpython/issues/104533
4f69961https://github.com/vstinner/cpython/commit/4f6996119ce840510136b5dad1f473f6d8f2ff83
gh-104533: Fix `@ctypes.util.struct` with string annotations (#154040)https://github.com/python/cpython/commit/83674483563c83550c87311adb557f8565916ce0
gh-104533https://github.com/python/cpython/issues/104533
#154040https://github.com/python/cpython/pull/154040
8367448https://github.com/python/cpython/commit/83674483563c83550c87311adb557f8565916ce0
gh-104533: Fix `@ctypes.util.struct` with endian (#154038)https://github.com/python/cpython/commit/e26005199b17792b47bed10096eaface7fc60b40
gh-104533https://github.com/python/cpython/issues/104533
#154038https://github.com/python/cpython/pull/154038
e260051https://github.com/python/cpython/commit/e26005199b17792b47bed10096eaface7fc60b40
gh-104533: Update test_ctypes.test_structures (#154091)https://github.com/python/cpython/commit/20b50f8ec4602fb108e029e6f84b2a19294a95d2
gh-104533https://github.com/python/cpython/issues/104533
#154091https://github.com/python/cpython/pull/154091
20b50f8https://github.com/python/cpython/commit/20b50f8ec4602fb108e029e6f84b2a19294a95d2
gh-104533: Use `@ctypes.util.struct` decorator (#154031)https://github.com/python/cpython/commit/ee50ed3ed010e26495300778b30b57da5cadc933
gh-104533https://github.com/python/cpython/issues/104533
#154031https://github.com/python/cpython/pull/154031
ee50ed3https://github.com/python/cpython/commit/ee50ed3ed010e26495300778b30b57da5cadc933
gh-104533: Fix ctypes test_pointer_proto_missing_argtypes_error() (#1…https://github.com/python/cpython/commit/da5713c489c63622c0fdd25343a7ea7293a66e68
gh-104533https://github.com/python/cpython/issues/104533
#1…https://github.com/python/cpython/pull/154169
da5713chttps://github.com/python/cpython/commit/da5713c489c63622c0fdd25343a7ea7293a66e68
https://github.com/fedonman
fedonmanhttps://github.com/fedonman
on Sep 23, 2026https://github.com/python/cpython/issues/104533#issuecomment-5787061831
@ZeroIntensityhttps://github.com/ZeroIntensity
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Sep 23, 2026https://github.com/python/cpython/issues/104533#issuecomment-5787396431
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/104533
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/104533
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
Ctypes issueshttps://github.com/orgs/python/projects/42
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.