diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/__init__.pyi | 33 | ||||
| -rw-r--r-- | numpy/core/multiarray.pyi | 30 | ||||
| -rw-r--r-- | numpy/core/src/multiarray/flagsobject.c | 2 |
3 files changed, 33 insertions, 32 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index dd12c9063..ca0c79b17 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -8,6 +8,7 @@ from abc import abstractmethod from types import TracebackType, MappingProxyType from contextlib import ContextDecorator +from numpy.core.multiarray import flagsobj from numpy.core._internal import _ctypes from numpy.typing import ( # Arrays @@ -1121,36 +1122,6 @@ class dtype(Generic[_DTypeScalar_co]): @property def type(self) -> Type[_DTypeScalar_co]: ... -class _flagsobj: - aligned: bool - updateifcopy: bool - writeable: bool - writebackifcopy: bool - @property - def behaved(self) -> bool: ... - @property - def c_contiguous(self) -> bool: ... - @property - def carray(self) -> bool: ... - @property - def contiguous(self) -> bool: ... - @property - def f_contiguous(self) -> bool: ... - @property - def farray(self) -> bool: ... - @property - def fnc(self) -> bool: ... - @property - def forc(self) -> bool: ... - @property - def fortran(self) -> bool: ... - @property - def num(self) -> int: ... - @property - def owndata(self) -> bool: ... - def __getitem__(self, key: str) -> bool: ... - def __setitem__(self, key: str, value: bool) -> None: ... - _ArrayLikeInt = Union[ int, integer, @@ -1203,7 +1174,7 @@ class _ArrayOrScalarCommon: @property def data(self) -> memoryview: ... @property - def flags(self) -> _flagsobj: ... + def flags(self) -> flagsobj: ... @property def itemsize(self) -> int: ... @property diff --git a/numpy/core/multiarray.pyi b/numpy/core/multiarray.pyi index bc33165be..072a15eb6 100644 --- a/numpy/core/multiarray.pyi +++ b/numpy/core/multiarray.pyi @@ -948,3 +948,33 @@ def compare_chararrays( ) -> NDArray[bool_]: ... def add_docstring(__obj: Callable[..., Any], __docstring: str) -> None: ... + +class flagsobj: + aligned: bool + updateifcopy: bool + writeable: bool + writebackifcopy: bool + @property + def behaved(self) -> bool: ... + @property + def c_contiguous(self) -> bool: ... + @property + def carray(self) -> bool: ... + @property + def contiguous(self) -> bool: ... + @property + def f_contiguous(self) -> bool: ... + @property + def farray(self) -> bool: ... + @property + def fnc(self) -> bool: ... + @property + def forc(self) -> bool: ... + @property + def fortran(self) -> bool: ... + @property + def num(self) -> int: ... + @property + def owndata(self) -> bool: ... + def __getitem__(self, key: str) -> bool: ... + def __setitem__(self, key: str, value: bool) -> None: ... diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c index c45d2ae96..fe73c18ee 100644 --- a/numpy/core/src/multiarray/flagsobject.c +++ b/numpy/core/src/multiarray/flagsobject.c @@ -779,7 +779,7 @@ arrayflags_new(PyTypeObject *NPY_UNUSED(self), PyObject *args, PyObject *NPY_UNU NPY_NO_EXPORT PyTypeObject PyArrayFlags_Type = { PyVarObject_HEAD_INIT(NULL, 0) - .tp_name = "numpy.flagsobj", + .tp_name = "numpy.core.multiarray.flagsobj", .tp_basicsize = sizeof(PyArrayFlagsObject), .tp_dealloc = (destructor)arrayflags_dealloc, .tp_repr = (reprfunc)arrayflags_print, |
