rename ctypes._FuncPtr (#13290)

fixes https://github.com/python/typeshed/issues/13289
This commit is contained in:
Stephen Morton
2024-12-24 10:16:57 -08:00
committed by GitHub
parent aaa8a7c47e
commit e5c5318115

View File

@@ -48,13 +48,13 @@ class ArgumentError(Exception): ...
# defined within CDLL.__init__
# Runtime name is ctypes.CDLL.__init__.<locals>._FuncPtr
@type_check_only
class _FuncPtr(_CFuncPtr):
class _CDLLFuncPointer(_CFuncPtr):
_flags_: ClassVar[int]
_restype_: ClassVar[type[_CDataType]]
# Not a real class; _FuncPtr with a __name__ set on it.
# Not a real class; _CDLLFuncPointer with a __name__ set on it.
@type_check_only
class _NamedFuncPointer(_FuncPtr):
class _NamedFuncPointer(_CDLLFuncPointer):
__name__: str
class CDLL:
@@ -62,7 +62,7 @@ class CDLL:
_func_restype_: ClassVar[type[_CDataType]]
_name: str
_handle: int
_FuncPtr: type[_FuncPtr]
_FuncPtr: type[_CDLLFuncPointer]
def __init__(
self,
name: str | None,
@@ -108,7 +108,7 @@ class _CFunctionType(_CFuncPtr):
_flags_: ClassVar[int]
# Alias for either function pointer type
_FuncPointer: TypeAlias = _FuncPtr | _CFunctionType # noqa: Y047 # not used here
_FuncPointer: TypeAlias = _CDLLFuncPointer | _CFunctionType # noqa: Y047 # not used here
def CFUNCTYPE(
restype: type[_CData | _CDataType] | None,