Skip to content

Commit 8317409

Browse files
authored
[ctypes] Replace two instances of Any (#14047)
1 parent afc1faa commit 8317409

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stdlib/_ctypes.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class _PyCPointerType(_CTypeBaseType):
114114
def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ...
115115
def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ...
116116
def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ...
117-
def set_type(self, type: Any, /) -> None: ...
117+
def set_type(self, type: _CTypeBaseType, /) -> None: ...
118118
if sys.version_info < (3, 13):
119119
# Inherited from CType_Type starting on 3.13
120120
def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]

stdlib/ctypes/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ from _ctypes import (
1111
_CData as _CData,
1212
_CDataType as _CDataType,
1313
_CField as _CField,
14+
_CTypeBaseType,
1415
_Pointer as _Pointer,
1516
_PointerLike as _PointerLike,
1617
_SimpleCData as _SimpleCData,
@@ -162,7 +163,7 @@ c_buffer = create_string_buffer
162163

163164
def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
164165
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
165-
def SetPointerType(pointer: type[_Pointer[Any]], cls: Any) -> None: ...
166+
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
166167
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... # Soft Deprecated, no plans to remove
167168

168169
if sys.platform == "win32":

0 commit comments

Comments
 (0)