numpy  2.0.0
src/multiarray/arrayobject.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT PyObject * _strings_richcompare (PyArrayObject *self, PyArrayObject *other, int cmp_op, int rstrip)
NPY_NO_EXPORT PyObject * array_richcompare (PyArrayObject *self, PyObject *other, int cmp_op)
NPY_NO_EXPORT int array_might_be_written (PyArrayObject *obj)

Variables

static const int NPY_ARRAY_WARN_ON_WRITE = (1 << 31)

Function Documentation

NPY_NO_EXPORT PyObject* _strings_richcompare ( PyArrayObject self,
PyArrayObject other,
int  cmp_op,
int  rstrip 
)
Cast arrays to a common type
Broad-cast the arrays to a common shape
Call this from contexts where an array might be written to, but we have no way to tell. (E.g., when converting to a read-write buffer.)
Only warn once per array

References PyArray_MIN.

Referenced by array_ctypes_get(), and array_repr().

NPY_NO_EXPORT PyObject* array_richcompare ( PyArrayObject self,
PyObject *  other,
int  cmp_op 
)
Make sure 'other' is an array
If not successful, indicate that the items cannot be compared this way.
If the comparison results in NULL, then the two array objects can not be compared together; indicate that
Make sure 'other' is an array
If not successful, indicate that the items cannot be compared this way.
Try to handle string comparisons

References PyArray_Check, PyArray_ITEMSIZE, PyArray_NDIM, and PyArray_STRIDES.


Variable Documentation

const int NPY_ARRAY_WARN_ON_WRITE = (1 << 31) [static]
This flag is used to mark arrays which we would like to, in the future, turn into views. It causes a warning to be issued on the first attempt to write to the array (but the write is allowed to succeed).
This flag is for internal use only, and may be removed in a future release, which is why the #define is not exposed to user code. Currently it is set on arrays returned by ndarray.diagonal.