MCPcopy Create free account
hub / github.com/numpy/numpy / PyArray_OptionalIntpConverter

Function PyArray_OptionalIntpConverter

numpy/core/src/multiarray/conversion_utils.c:217–225  ·  view source on GitHub ↗

* Like PyArray_IntpConverter, but leaves `seq` untouched if `None` is passed * rather than treating `None` as `()`. */

Source from the content-addressed store, hash-verified

215 * rather than treating `None` as `()`.
216 */
217NPY_NO_EXPORT int
218PyArray_OptionalIntpConverter(PyObject *obj, PyArray_Dims *seq)
219{
220 if (obj == Py_None) {
221 return NPY_SUCCEED;
222 }
223
224 return PyArray_IntpConverter(obj, seq);
225}
226
227NPY_NO_EXPORT int
228PyArray_CopyConverter(PyObject *obj, _PyArray_CopyMode *copymode) {

Callers 1

array_strides_setFunction · 0.85

Calls 1

PyArray_IntpConverterFunction · 0.85

Tested by

no test coverage detected