Skip to content

Commit f583b76

Browse files
committed
codegen: Fix function pointer mypy errors
typeshed was missing the no-arguments constructor for `_ctypes.CFuncPtr` until very recently. python/typeshed#10154 generated\nidaqmx\_library_interpreter.py:4414: error: All overload variants of "_FuncPointer" require at least one argument [call-overload] generated\nidaqmx\_library_interpreter.py:4414: note: Possible overload variants: generated\nidaqmx\_library_interpreter.py:4414: note: def _FuncPointer(self, address: int) -> _FuncPointer generated\nidaqmx\_library_interpreter.py:4414: note: def _FuncPointer(self, callable: Callable[..., Any]) -> _FuncPointer generated\nidaqmx\_library_interpreter.py:4414: note: def _FuncPointer(self, func_spec: Tuple[Union[str, int], CDLL], paramflags: Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ...) -> _FuncPointer generated\nidaqmx\_library_interpreter.py:4414: note: def _FuncPointer(self, vtlb_index: int, name: str, paramflags: Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., iid: _Pointer[c_int] = ...) -> _FuncPointer Signed-off-by: Brad Keryan <[email protected]>
1 parent b47566b commit f583b76

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

generated/nidaqmx/_library_interpreter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5483,7 +5483,7 @@ def unregister_done_event(self, task):
54835483
ctypes.POINTER(ctypes.c_void_p)]
54845484

54855485
options = 0
5486-
callback_method_ptr = DAQmxDoneEventCallbackPtr()
5486+
callback_method_ptr = DAQmxDoneEventCallbackPtr() # type: ignore # typeshed is missing no-argument constructor overload
54875487
callback_data = None
54885488

54895489
error_code = cfunc(
@@ -5507,7 +5507,7 @@ def unregister_every_n_samples_event(
55075507

55085508
n_samples = 0
55095509
options = 0
5510-
callback_method_ptr = DAQmxEveryNSamplesEventCallbackPtr()
5510+
callback_method_ptr = DAQmxEveryNSamplesEventCallbackPtr() # type: ignore # typeshed is missing no-argument constructor overload
55115511
callback_data = None
55125512

55135513
error_code = cfunc(
@@ -5530,7 +5530,7 @@ def unregister_signal_event(self, task, signal_id):
55305530
ctypes.POINTER(ctypes.c_void_p)]
55315531

55325532
options = 0
5533-
callback_method_ptr = DAQmxSignalEventCallbackPtr()
5533+
callback_method_ptr = DAQmxSignalEventCallbackPtr() # type: ignore # typeshed is missing no-argument constructor overload
55345534
callback_data = None
55355535

55365536
error_code = cfunc(

src/codegen/templates/library_interpreter/event_function_call.py.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
n_samples = 0
4040
%endif
4141
options = 0
42-
callback_method_ptr = ${callback_func_param.type}()
42+
callback_method_ptr = ${callback_func_param.type}() # type: ignore # typeshed is missing no-argument constructor overload
4343
callback_data = None
4444
%endif
4545

0 commit comments

Comments
 (0)