From fa0c14fa330ee28fc32e93079a7264d2b1a32d97 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Sat, 20 Jul 2024 14:21:36 -0500 Subject: [PATCH] Enforce Positional Arguments for `_CData.from_param` (#12373) --- stdlib/@tests/stubtest_allowlists/py313.txt | 5 ----- stdlib/_ctypes.pyi | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 268b03053..7d6b8870f 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -14,11 +14,6 @@ ctypes._endian.SIZEOF_TIME_T ctypes._endian.cdll ctypes._endian.pydll ctypes._endian.pythonapi -ctypes.c_char_p.from_param -ctypes.c_void_p.from_param -ctypes.c_wchar_p.from_param -ctypes.wintypes.PCHAR.from_param -ctypes.wintypes.PWCHAR.from_param doctest.TestResults.__doc__ doctest.TestResults.__new__ filecmp.dircmp.__init__ diff --git a/stdlib/_ctypes.pyi b/stdlib/_ctypes.pyi index 5be81fa53..c1fb86193 100644 --- a/stdlib/_ctypes.pyi +++ b/stdlib/_ctypes.pyi @@ -71,7 +71,7 @@ class _CData(metaclass=_CDataMeta): @classmethod def from_address(cls, address: int) -> Self: ... @classmethod - def from_param(cls, obj: Any) -> Self | _CArgObject: ... + def from_param(cls, value: Any, /) -> Self | _CArgObject: ... @classmethod def in_dll(cls, library: CDLL, name: str) -> Self: ... def __buffer__(self, flags: int, /) -> memoryview: ...