Use positional-only parameters for ctypes functions (#12341)

This commit is contained in:
Max Muoto
2024-07-14 00:16:42 -05:00
committed by GitHub
parent 16341c749a
commit 1b9e90baab
2 changed files with 7 additions and 18 deletions

View File

@@ -3,11 +3,6 @@
# =========================
# TODO: triage these new errors
_ctypes.POINTER
_ctypes.addressof
_ctypes.alignment
_ctypes.pointer
_ctypes.sizeof
_thread.interrupt_main
_thread.lock
_thread.start_joinable_thread
@@ -18,7 +13,6 @@ codecs.namereplace_errors
codecs.replace_errors
codecs.strict_errors
codecs.xmlcharrefreplace_errors
ctypes.POINTER
ctypes._endian.DEFAULT_MODE
ctypes._endian.RTLD_GLOBAL
ctypes._endian.RTLD_LOCAL
@@ -26,13 +20,9 @@ ctypes._endian.SIZEOF_TIME_T
ctypes._endian.cdll
ctypes._endian.pydll
ctypes._endian.pythonapi
ctypes.addressof
ctypes.alignment
ctypes.c_char_p.from_param
ctypes.c_void_p.from_param
ctypes.c_wchar_p.from_param
ctypes.pointer
ctypes.sizeof
ctypes.wintypes.PCHAR.from_param
ctypes.wintypes.PWCHAR.from_param
doctest.TestResults.__doc__

View File

@@ -64,7 +64,6 @@ class _CData(metaclass=_CDataMeta):
# Structure.from_buffer(...) # valid at runtime
# Structure(...).from_buffer(...) # invalid at runtime
#
@classmethod
def from_buffer(cls, source: WriteableBuffer, offset: int = ...) -> Self: ...
@classmethod
@@ -100,8 +99,8 @@ class _Pointer(_PointerLike, _CData, Generic[_CT]):
def __getitem__(self, key: slice, /) -> list[Any]: ...
def __setitem__(self, key: int, value: Any, /) -> None: ...
def POINTER(type: type[_CT]) -> type[_Pointer[_CT]]: ...
def pointer(arg: _CT, /) -> _Pointer[_CT]: ...
def POINTER(type: type[_CT], /) -> type[_Pointer[_CT]]: ...
def pointer(obj: _CT, /) -> _Pointer[_CT]: ...
class _CArgObject: ...
@@ -203,9 +202,9 @@ class Array(_CData, Generic[_CT]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def addressof(obj: _CData) -> int: ...
def alignment(obj_or_type: _CData | type[_CData]) -> int: ...
def addressof(obj: _CData, /) -> int: ...
def alignment(obj_or_type: _CData | type[_CData], /) -> int: ...
def get_errno() -> int: ...
def resize(obj: _CData, size: int) -> None: ...
def set_errno(value: int) -> int: ...
def sizeof(obj_or_type: _CData | type[_CData]) -> int: ...
def resize(obj: _CData, size: int, /) -> None: ...
def set_errno(value: int, /) -> int: ...
def sizeof(obj_or_type: _CData | type[_CData], /) -> int: ...