From 929ee9e09c7a93e5e16d46d77bf4975f78735184 Mon Sep 17 00:00:00 2001 From: tqfx Date: Fri, 5 Apr 2024 23:26:20 +0800 Subject: [PATCH] update type hints of liba.array --- python/liba.pyi | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/python/liba.pyi b/python/liba.pyi index 918adac..a9bb235 100644 --- a/python/liba.pyi +++ b/python/liba.pyi @@ -4,6 +4,10 @@ _T = TypeVar("_T", int, float) class memoryview(Iterable[_T]): # built in cython def __len__(self) -> int: ... + def is_c_contig(self) -> bool: ... + def is_f_contig(self) -> bool: ... + def copy(self) -> memoryview[_T]: ... + def copy_fortran(self) -> memoryview[_T]: ... @overload def __getitem__(self, key: SupportsIndex, /) -> _T: ... @overload @@ -13,10 +17,6 @@ class memoryview(Iterable[_T]): # built in cython @overload def __setitem__(self, key: slice, value: array[_T], /) -> None: ... def __delitem__(self, key: SupportsIndex | slice, /) -> None: ... - def copy_fortran(self) -> memoryview[_T]: ... - def copy(self) -> memoryview[_T]: ... - def is_c_contig(self) -> bool: ... - def is_f_contig(self) -> bool: ... @property def T(self) -> memoryview[_T]: ... @property @@ -38,6 +38,10 @@ class memoryview(Iterable[_T]): # built in cython class array(Sequence[_T]): # built in cython def __len__(self) -> int: ... + def is_c_contig(self) -> bool: ... + def is_f_contig(self) -> bool: ... + def copy(self) -> memoryview[_T]: ... + def copy_fortran(self) -> memoryview[_T]: ... @overload def __getitem__(self, key: SupportsIndex, /) -> _T: ... @overload @@ -49,6 +53,24 @@ class array(Sequence[_T]): # built in cython def __delitem__(self, key: SupportsIndex | slice, /) -> None: ... @property def memview(self) -> memoryview[_T]: ... + @property + def T(self) -> memoryview[_T]: ... + @property + def base(self) -> array[_T]: ... + @property + def itemsize(self) -> int: ... + @property + def nbytes(self) -> int: ... + @property + def ndim(self) -> int: ... + @property + def shape(self) -> tuple[int]: ... + @property + def size(self) -> int: ... + @property + def strides(self) -> tuple[int]: ... + @property + def suboffsets(self) -> tuple[int]: ... def isqrt(x: int) -> int: ... @overload -- 2.11.4.GIT