From 47ebfbf8759d1dee30cf906575121cf6728932c6 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 5 Aug 2026 14:39:05 +0200 Subject: [PATCH 1/2] [_ctypes] Add `dllist()` --- stdlib/_ctypes.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/_ctypes.pyi b/stdlib/_ctypes.pyi index 36365cea3aa8..3b25f6fcb551 100644 --- a/stdlib/_ctypes.pyi +++ b/stdlib/_ctypes.pyi @@ -373,3 +373,6 @@ def Py_INCREF(o: _T, /) -> _T: ... def buffer_info(o: _CData | _CDataType | type[_CData | _CDataType], /) -> tuple[str, int, tuple[int, ...]]: ... def call_cdeclfunction(address: int, arguments: tuple[Any, ...], /) -> Any: ... def call_function(address: int, arguments: tuple[Any, ...], /) -> Any: ... + +if sys.version_info >= (3, 15) and sys.platform != "win32" and sys.platform != "darwin": + def dllist() -> list[str]: ... From 2926188f69d167861150e9abdc382dda80c56e9a Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 5 Aug 2026 14:54:38 +0200 Subject: [PATCH 2/2] Add a comment --- stdlib/_ctypes.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/_ctypes.pyi b/stdlib/_ctypes.pyi index 3b25f6fcb551..4c65802c4b31 100644 --- a/stdlib/_ctypes.pyi +++ b/stdlib/_ctypes.pyi @@ -374,5 +374,6 @@ def buffer_info(o: _CData | _CDataType | type[_CData | _CDataType], /) -> tuple[ def call_cdeclfunction(address: int, arguments: tuple[Any, ...], /) -> Any: ... def call_function(address: int, arguments: tuple[Any, ...], /) -> Any: ... +# dllist() is available on Linux and other platforms like NetBSD if sys.version_info >= (3, 15) and sys.platform != "win32" and sys.platform != "darwin": def dllist() -> list[str]: ...