numpy  2.0.0
src/multiarray/sequence.c File Reference
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "common.h"
#include "mapping.h"
#include "sequence.h"

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define _MULTIARRAYMODULE

Functions

static int array_any_nonzero (PyArrayObject *mp)
static PyObject * array_slice (PyArrayObject *self, Py_ssize_t ilow, Py_ssize_t ihigh)
static int array_ass_slice (PyArrayObject *self, Py_ssize_t ilow, Py_ssize_t ihigh, PyObject *v)
static int array_contains (PyArrayObject *self, PyObject *el)

Variables

NPY_NO_EXPORT PySequenceMethods array_as_sequence

Define Documentation

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION

Function Documentation

static int array_any_nonzero ( PyArrayObject arr) [static]
************ End of Sequence Protocol ***********************
Helpers
Array evaluates as "TRUE" if any of the elements are non-zero
static int array_ass_slice ( PyArrayObject self,
Py_ssize_t  ilow,
Py_ssize_t  ihigh,
PyObject *  v 
) [static]

Referenced by array_contains().

static int array_contains ( PyArrayObject self,
PyObject *  el 
) [static]
equivalent to (self == el).any()

References array_ass_item, array_ass_slice(), array_item_nice(), array_length(), and array_slice().

static PyObject* array_slice ( PyArrayObject self,
Py_ssize_t  ilow,
Py_ssize_t  ihigh 
) [static]

*********** Implement Sequence Protocol **********************

System Message: WARNING/2 (<string>, line 1)
Title overline too short.

   Implement Sequence Protocol **************************
 
Some of this is repeated in the array_as_mapping protocol. But
we fill it in here so that PySequence_XXXX calls work as expected
Same shape except dimension 0

Referenced by array_contains().


Variable Documentation

NPY_NO_EXPORT PySequenceMethods array_as_sequence