Skip to content

Commit 1bf8d50

Browse files
authored
ctypes.CDLL._func_restype_ is a type, not an instance (#13206)
1 parent 633a4d7 commit 1bf8d50

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/ctypes/__init__.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ArgumentError(Exception): ...
4747

4848
class CDLL:
4949
_func_flags_: ClassVar[int]
50-
_func_restype_: ClassVar[_CDataType]
50+
_func_restype_: ClassVar[type[_CDataType]]
5151
_name: str
5252
_handle: int
5353
_FuncPtr: type[_FuncPointer]
@@ -202,7 +202,10 @@ if sys.platform == "win32":
202202
class HRESULT(_SimpleCData[int]): ... # TODO undocumented
203203

204204
if sys.version_info >= (3, 12):
205-
c_time_t: type[c_int32 | c_int64] # alias for one or the other at runtime
205+
# At runtime, this is an alias for either c_int32 or c_int64,
206+
# which are themselves an alias for one of c_short, c_int, c_long, or c_longlong
207+
# This covers all our bases.
208+
c_time_t: type[c_int32 | c_int64 | c_short | c_int | c_long | c_longlong]
206209

207210
class py_object(_CanCastTo, _SimpleCData[_T]): ...
208211

0 commit comments

Comments
 (0)