René's URL Explorer Experiment


Title: Annotation-based decorator for `ctypes` function pointers · Issue #153903 · python/cpython · GitHub

Open Graph Title: Annotation-based decorator for `ctypes` function pointers · Issue #153903 · python/cpython

X Title: Annotation-based decorator for `ctypes` function pointers · Issue #153903 · python/cpython

Description: Feature or enhancement Proposal: The idea is to add a decorator that extracts type annotations and a name for a function signature, and then use that information to generate argtypes and restype for a _CFuncPtr object. For example: @wrap...

Open Graph Description: Feature or enhancement Proposal: The idea is to add a decorator that extracts type annotations and a name for a function signature, and then use that information to generate argtypes and restype fo...

X Description: Feature or enhancement Proposal: The idea is to add a decorator that extracts type annotations and a name for a function signature, and then use that information to generate argtypes and restype fo...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Annotation-based decorator for `ctypes` function pointers","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nThe idea is to add a decorator that extracts type annotations and a name for a function signature, and then use that information to generate `argtypes` and `restype` for a `_CFuncPtr` object. For example:\n\n```py\n@wrap_dll_function(ctypes.pythonapi)\ndef PyObject_GetAttrString(op: ctypes.py_object, attr: ctypes.c_char_p) -> ctypes.py_object:\n    ...\n```\n\nSee #104533 for prior work.\n\n\n### Has this already been discussed elsewhere?\n\nI have already discussed this feature proposal on Discourse\n\n### Links to previous discussion of this feature:\n\nhttps://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-153904\n* gh-154030\n* gh-154042\n* gh-154122\n* gh-154495\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ZeroIntensity","@type":"Person","name":"ZeroIntensity"},"datePublished":"2026-07-18T10:13:49Z","url":"https://github.com/python/cpython/issues/153903"}

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:be94d65a-a36d-c523-1650-2ca2ce0540ba
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCB06:D064:29A9009:38C057C:6B004B6B
html-safe-nonce7059521bcbd5eb00bdf9a200b0d119291a1ad21f8ac57ab41c9995b61124cfa4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjA2OkQwNjQ6MjlBOTAwOTozOEMwNTdDOjZCMDA0QjZCIiwidmlzaXRvcl9pZCI6IjczNDgxMzE3MDM1MDE4MTIyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac456afd2f49d1233382106c5bd7d10f4cdc92c825ee093c4b492a120ced853fce
hovercard-subject-tagissue:4917828406
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/153903/issue_layout
twitter:imagehttps://opengraph.githubassets.com/742423096b574a13073df461b1246e16b444dd6c265570aaaa93c9196e6a978f/python/cpython/issues/153903
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/742423096b574a13073df461b1246e16b444dd6c265570aaaa93c9196e6a978f/python/cpython/issues/153903
og:image:altFeature or enhancement Proposal: The idea is to add a decorator that extracts type annotations and a name for a function signature, and then use that information to generate argtypes and restype fo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameZeroIntensity
hostnamegithub.com
expected-hostnamegithub.com
Nonef9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b
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
releaseb27c5dde30676028abd5c5fc53ce5c9b625f8281
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/153903#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F153903
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%2F153903
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/153903
Reloadhttps://github.com/python/cpython/issues/153903
Reloadhttps://github.com/python/cpython/issues/153903
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/153903
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/153903
Annotation-based decorator for ctypes function pointershttps://github.com/python/cpython/issues/153903#top
https://github.com/ZeroIntensity
sprinthttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22sprint%22
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/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 18, 2026https://github.com/python/cpython/issues/153903#issue-4917828406
#104533https://github.com/python/cpython/issues/104533
https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579
gh-153903: Add a ctypes decorator for generating function pointers using annotations #153904https://github.com/python/cpython/pull/153904
gh-153903: Use @ctypes.util.wrap_dll_function() with pythonapi #154030https://github.com/python/cpython/pull/154030
gh-153903: Fix ctypes wrap_dll_function() with string annotations #154042https://github.com/python/cpython/pull/154042
gh-153903: Use @ctypes.util.wrap_dll_function() #154122https://github.com/python/cpython/pull/154122
gh-153903: wrap_dll_function: copy doc, etc from wrapped stub #154495https://github.com/python/cpython/pull/154495
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 18, 2026https://github.com/python/cpython/issues/153903#event-28156483005
ZeroIntensityhttps://github.com/ZeroIntensity
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
sprinthttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22sprint%22
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
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/153903#event-28156483328
github-project-automationhttps://github.com/apps/github-project-automation
Sprinthttps://github.com/orgs/python/projects/32
on Jul 18, 2026https://github.com/python/cpython/issues/153903#event-28156484572
github-project-automationhttps://github.com/apps/github-project-automation
Sprinthttps://github.com/orgs/python/projects/32
on Jul 18, 2026https://github.com/python/cpython/issues/153903
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 18, 2026https://github.com/python/cpython/issues/153903#event-28158449412
gh-153903: Add a `ctypes` decorator for generating function pointers …https://github.com/python/cpython/commit/0e81ef93ebd87607c8d946e7dfb6940c5fe9f083
gh-153903https://github.com/python/cpython/issues/153903
0e81ef9https://github.com/python/cpython/commit/0e81ef93ebd87607c8d946e7dfb6940c5fe9f083
ZeroIntensityhttps://github.com/ZeroIntensity
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 18, 2026https://github.com/python/cpython/issues/153903#event-28158451008
github-project-automationhttps://github.com/apps/github-project-automation
Sprinthttps://github.com/orgs/python/projects/32
on Jul 18, 2026https://github.com/python/cpython/issues/153903
vstinnerhttps://github.com/vstinner
on Jul 19, 2026https://github.com/python/cpython/issues/153903#event-28171024752
pythongh-153903: Fix ctypes wrap_dll_function() with string annotationshttps://github.com/vstinner/cpython/commit/6e43e3f3983f9b8f8b4777dfbf24da8bb994f906
pythongh-153903https://github.com/python/cpython/issues/153903
6e43e3fhttps://github.com/vstinner/cpython/commit/6e43e3f3983f9b8f8b4777dfbf24da8bb994f906
gh-153903: Fix ctypes wrap_dll_function() with string annotations (#1…https://github.com/python/cpython/commit/d5eb31209699ef59857780a5530191031ee3f796
gh-153903https://github.com/python/cpython/issues/153903
#1…https://github.com/python/cpython/pull/154042
d5eb312https://github.com/python/cpython/commit/d5eb31209699ef59857780a5530191031ee3f796
gh-153903: Use `@ctypes.util.wrap_dll_function()` with pythonapi (#15…https://github.com/python/cpython/commit/84897d2e30b1b478f3de4fb9a7cd41fc2363da80
gh-153903https://github.com/python/cpython/issues/153903
#15…https://github.com/python/cpython/pull/154030
84897d2https://github.com/python/cpython/commit/84897d2e30b1b478f3de4fb9a7cd41fc2363da80
gh-153903: Use `@ctypes.util.wrap_dll_function()` (#154122)https://github.com/python/cpython/commit/249d5e0a10839f9891caa85de35a8a9cf5d7a3a3
gh-153903https://github.com/python/cpython/issues/153903
#154122https://github.com/python/cpython/pull/154122
249d5e0https://github.com/python/cpython/commit/249d5e0a10839f9891caa85de35a8a9cf5d7a3a3
https://github.com/WardBrian
WardBrianhttps://github.com/WardBrian
on Jul 21, 2026https://github.com/python/cpython/issues/153903#issuecomment-5034899839
gh-153904https://github.com/python/cpython/pull/153904
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 21, 2026https://github.com/python/cpython/issues/153903#issuecomment-5036002953
https://github.com/WardBrian
WardBrianhttps://github.com/WardBrian
on Jul 21, 2026https://github.com/python/cpython/issues/153903#issuecomment-5036450389
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 21, 2026https://github.com/python/cpython/issues/153903#issuecomment-5039093625
https://github.com/WardBrian
WardBrianhttps://github.com/WardBrian
on Jul 21, 2026https://github.com/python/cpython/issues/153903#issuecomment-5039230052
ZeroIntensityhttps://github.com/ZeroIntensity
on Jul 23, 2026https://github.com/python/cpython/issues/153903#event-28394673562
gh-153903: Copy docstrings and other metadata in `ctypes.util.wrap_dl…https://github.com/python/cpython/commit/2b4e062a277f888c0139ac7196c2b6dcaed795dc
gh-153903https://github.com/python/cpython/issues/153903
2b4e062https://github.com/python/cpython/commit/2b4e062a277f888c0139ac7196c2b6dcaed795dc
skirpichevhttps://github.com/skirpichev
Annotation-based syntax for ctypes functions #104532https://github.com/python/cpython/issues/104532
on Aug 10, 2026https://github.com/python/cpython/issues/153903#event-29198080040
mbeijenhttps://github.com/mbeijen
on Aug 14, 2026https://github.com/python/cpython/issues/153903#event-29455487580
pythongh-153903: Copy docstrings and other metadata in `ctypes.util.w…https://github.com/mbeijen/cpython/commit/23b4f2b32c09906dc07cd41aeed3ab6bdc7d96f4
pythongh-153903https://github.com/python/cpython/issues/153903
23b4f2bhttps://github.com/mbeijen/cpython/commit/23b4f2b32c09906dc07cd41aeed3ab6bdc7d96f4
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/153903
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/153903
ZeroIntensityhttps://github.com/ZeroIntensity
sprinthttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22sprint%22
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
Sprinthttps://github.com/orgs/python/projects/32
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.