fix the __init__ of several C-classes (#13211)

This commit is contained in:
Stephen Morton
2024-12-23 10:55:51 -08:00
committed by GitHub
parent bfb9a91950
commit 17408ee538
23 changed files with 160 additions and 111 deletions

View File

@@ -24,19 +24,21 @@ class array(MutableSequence[_T]):
@property
def itemsize(self) -> int: ...
@overload
def __init__(self: array[int], typecode: _IntTypeCode, initializer: bytes | bytearray | Iterable[int] = ..., /) -> None: ...
def __new__(
cls: type[array[int]], typecode: _IntTypeCode, initializer: bytes | bytearray | Iterable[int] = ..., /
) -> array[int]: ...
@overload
def __init__(
self: array[float], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ..., /
) -> None: ...
def __new__(
cls: type[array[float]], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ..., /
) -> array[float]: ...
@overload
def __init__(
self: array[str], typecode: _UnicodeTypeCode, initializer: bytes | bytearray | Iterable[str] = ..., /
) -> None: ...
def __new__(
cls: type[array[str]], typecode: _UnicodeTypeCode, initializer: bytes | bytearray | Iterable[str] = ..., /
) -> array[str]: ...
@overload
def __init__(self, typecode: str, initializer: Iterable[_T], /) -> None: ...
def __new__(cls, typecode: str, initializer: Iterable[_T], /) -> Self: ...
@overload
def __init__(self, typecode: str, initializer: bytes | bytearray = ..., /) -> None: ...
def __new__(cls, typecode: str, initializer: bytes | bytearray = ..., /) -> Self: ...
def append(self, v: _T, /) -> None: ...
def buffer_info(self) -> tuple[int, int]: ...
def byteswap(self) -> None: ...