[issue43208] Ctypes._FuncPtr.restype doesn't handle NoneType correctly

2021-02-12 Thread Eryk Sun
Eryk Sun added the comment: NoneType would have to be replaced with None in make_funcptrtype_dict() and PyCFuncPtr_set_restype() in Modules/_ctypes/_ctypes.c. In the C API, NoneType is (PyObject *)&_PyNone_Type. -- nosy: +eryksun ___ Python

[issue43208] Ctypes._FuncPtr.restype doesn't handle NoneType correctly

2021-02-12 Thread Thijs Miedema
New submission from Thijs Miedema : When setting the restype of a ctypes._FuncPtr you can use None to indicate a void function. However, I use inspect.signature to dynamically bind python functions to a DLL, and that doesn't return None but NoneType if the type hint return type is None