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

Function PyArray_BoolConverter

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

NUMPY_API * Convert an object to true / false */

Source from the content-addressed store, hash-verified

425 * Convert an object to true / false
426 */
427NPY_NO_EXPORT int
428PyArray_BoolConverter(PyObject *object, npy_bool *val)
429{
430 if (PyObject_IsTrue(object)) {
431 *val = NPY_TRUE;
432 }
433 else {
434 *val = NPY_FALSE;
435 }
436 if (PyErr_Occurred()) {
437 return NPY_FAIL;
438 }
439 return NPY_SUCCEED;
440}
441
442static int
443string_converter_helper(

Callers 1

PyArray_CopyConverterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected