-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
stubs: incompleteAnnotations or sub-modules missing from an existing package or moduleAnnotations or sub-modules missing from an existing package or module
Description
My projects use some COM-ffi packages.
I use _ctypes.COMError
or _ctypes.CopyComPointer
too, but they are not defined in the type stub, so mypy
type checker raises Cannot find implementation or library stub for module named "_ctypes"
error.
I would like to add type stubs like this.
from ctypes import _CArgObject, _PointerLike
# are they correct?
_COMError_Details = tuple[str | None, str | None, str | None, int | None, int | None] # Description, Source, HelpFile, HelpContext, scode
class COMError(Exception):
"""Raised when a COM method call failed."""
hresult: int
text: str
details: _COMError_Details
def __init__(self, hresult: _COMError_HResult, text: str, details: _COMError_Details) -> None: ...
def CopyComPointer(src: _PointerLike, dst: _PointerLike | _CArgObject) -> int: ... # `dst` sometimes maybe return value of `ctypes.byref`.
"""CopyComPointer(src, dst) -> HRESULT value"""
But other APIs are not clear to me.
- and where the
if sys.platform == "win32":
needed.
Any opinions would be appreciated.
Metadata
Metadata
Assignees
Labels
stubs: incompleteAnnotations or sub-modules missing from an existing package or moduleAnnotations or sub-modules missing from an existing package or module