-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Annotation-based decorator for ctypes function pointers #153903
Copy link
Copy link
Closed
Labels
sprintstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-ctypestype-featureA feature request or enhancementA feature request or enhancement
Description
Activity
Metadata
Metadata
Assignees
Labels
sprintstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-ctypestype-featureA feature request or enhancementA feature request or enhancement
Projects
- StatusShow more project fieldsDone
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
argtypesandrestypefor a_CFuncPtrobject. For example:See #104533 for prior work.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/annotation-based-sugar-for-ctypes/26579
Linked PRs
ctypesdecorator for generating function pointers using annotations #153904@ctypes.util.wrap_dll_function()with pythonapi #154030@ctypes.util.wrap_dll_function()#154122