mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
fix _ctypes.CFuncPtr constructor args (#10154)
* add a conditional branch for Windows only * fix argname spelling `vtlb_index` -> `vtbl_index` * add an overload for the case where no arguments are passed to the constructor * mark all of the arguments as positional-only
This commit is contained in:
@@ -102,13 +102,19 @@ class CFuncPtr(_PointerLike, _CData):
|
||||
errcheck: _ECT
|
||||
_flags_: ClassVar[int] # Abstract attribute that must be defined on subclasses
|
||||
@overload
|
||||
def __init__(self, address: int) -> None: ...
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, callable: Callable[..., Any]) -> None: ...
|
||||
def __init__(self, __address: int) -> None: ...
|
||||
@overload
|
||||
def __init__(self, func_spec: tuple[str | int, CDLL], paramflags: tuple[_PF, ...] = ...) -> None: ...
|
||||
def __init__(self, __callable: Callable[..., Any]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, vtlb_index: int, name: str, paramflags: tuple[_PF, ...] = ..., iid: _Pointer[c_int] = ...) -> None: ...
|
||||
def __init__(self, __func_spec: tuple[str | int, CDLL], __paramflags: tuple[_PF, ...] = ...) -> None: ...
|
||||
if sys.platform == "win32":
|
||||
@overload
|
||||
def __init__(
|
||||
self, __vtbl_index: int, __name: str, __paramflags: tuple[_PF, ...] = ..., __iid: _Pointer[c_int] = ...
|
||||
) -> None: ...
|
||||
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
class _CField:
|
||||
|
||||
Reference in New Issue
Block a user