Skip to content

Commit edb880d

Browse files
authored
Merge pull request numpy#19434 from BvB93/flagsobj
MAINT: Fix the module of `flagsobj`
2 parents f128be6 + 9c1bfcc commit edb880d

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

numpy/__init__.pyi

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ from abc import abstractmethod
88
from types import TracebackType, MappingProxyType
99
from contextlib import ContextDecorator
1010

11+
from numpy.core.multiarray import flagsobj
1112
from numpy.core._internal import _ctypes
1213
from numpy.typing import (
1314
# Arrays
@@ -1121,36 +1122,6 @@ class dtype(Generic[_DTypeScalar_co]):
11211122
@property
11221123
def type(self) -> Type[_DTypeScalar_co]: ...
11231124

1124-
class _flagsobj:
1125-
aligned: bool
1126-
updateifcopy: bool
1127-
writeable: bool
1128-
writebackifcopy: bool
1129-
@property
1130-
def behaved(self) -> bool: ...
1131-
@property
1132-
def c_contiguous(self) -> bool: ...
1133-
@property
1134-
def carray(self) -> bool: ...
1135-
@property
1136-
def contiguous(self) -> bool: ...
1137-
@property
1138-
def f_contiguous(self) -> bool: ...
1139-
@property
1140-
def farray(self) -> bool: ...
1141-
@property
1142-
def fnc(self) -> bool: ...
1143-
@property
1144-
def forc(self) -> bool: ...
1145-
@property
1146-
def fortran(self) -> bool: ...
1147-
@property
1148-
def num(self) -> int: ...
1149-
@property
1150-
def owndata(self) -> bool: ...
1151-
def __getitem__(self, key: str) -> bool: ...
1152-
def __setitem__(self, key: str, value: bool) -> None: ...
1153-
11541125
_ArrayLikeInt = Union[
11551126
int,
11561127
integer,
@@ -1203,7 +1174,7 @@ class _ArrayOrScalarCommon:
12031174
@property
12041175
def data(self) -> memoryview: ...
12051176
@property
1206-
def flags(self) -> _flagsobj: ...
1177+
def flags(self) -> flagsobj: ...
12071178
@property
12081179
def itemsize(self) -> int: ...
12091180
@property

numpy/core/multiarray.pyi

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,3 +948,33 @@ def compare_chararrays(
948948
) -> NDArray[bool_]: ...
949949

950950
def add_docstring(__obj: Callable[..., Any], __docstring: str) -> None: ...
951+
952+
class flagsobj:
953+
aligned: bool
954+
updateifcopy: bool
955+
writeable: bool
956+
writebackifcopy: bool
957+
@property
958+
def behaved(self) -> bool: ...
959+
@property
960+
def c_contiguous(self) -> bool: ...
961+
@property
962+
def carray(self) -> bool: ...
963+
@property
964+
def contiguous(self) -> bool: ...
965+
@property
966+
def f_contiguous(self) -> bool: ...
967+
@property
968+
def farray(self) -> bool: ...
969+
@property
970+
def fnc(self) -> bool: ...
971+
@property
972+
def forc(self) -> bool: ...
973+
@property
974+
def fortran(self) -> bool: ...
975+
@property
976+
def num(self) -> int: ...
977+
@property
978+
def owndata(self) -> bool: ...
979+
def __getitem__(self, key: str) -> bool: ...
980+
def __setitem__(self, key: str, value: bool) -> None: ...

numpy/core/src/multiarray/flagsobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ arrayflags_new(PyTypeObject *NPY_UNUSED(self), PyObject *args, PyObject *NPY_UNU
779779

780780
NPY_NO_EXPORT PyTypeObject PyArrayFlags_Type = {
781781
PyVarObject_HEAD_INIT(NULL, 0)
782-
.tp_name = "numpy.flagsobj",
782+
.tp_name = "numpy.core.multiarray.flagsobj",
783783
.tp_basicsize = sizeof(PyArrayFlagsObject),
784784
.tp_dealloc = (destructor)arrayflags_dealloc,
785785
.tp_repr = (reprfunc)arrayflags_print,

0 commit comments

Comments
 (0)