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 "numpy/npy_3kcompat.h"
#include "common.h"
#include "mapping.h"
#include "sequence.h"

Defines

#define PY_SSIZE_T_CLEAN
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX

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 _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#define PY_SSIZE_T_CLEAN

Function Documentation

static int array_any_nonzero ( PyArrayObject mp) [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]
static int array_contains ( PyArrayObject self,
PyObject *  el 
) [static]

equivalent to (self == el).any()

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

Variable Documentation

NPY_NO_EXPORT PySequenceMethods array_as_sequence