numpy 2.0.0
src/multiarray/convert_datatype.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT
PyArray_VectorUnaryFunc
PyArray_GetCastFunc (PyArray_Descr *descr, int type_num)
NPY_NO_EXPORT int PyArray_ObjectType (PyObject *op, int minimum_type)
NPY_NO_EXPORT PyArrayObject ** PyArray_ConvertToCommonType (PyObject *op, int *retn)
NPY_NO_EXPORT int PyArray_ValidType (int type)

Function Documentation

NPY_NO_EXPORT PyArrayObject** PyArray_ConvertToCommonType ( PyObject *  op,
int *  retn 
)
Raises error when len(op) == 0

all scalars
we need to upconvert to type that handles both intype and stype also don't forcecast the scalars.
Make sure all arrays are actual array objects.
forcecast scalars

NPY_NO_EXPORT PyArray_VectorUnaryFunc* PyArray_GetCastFunc ( PyArray_Descr descr,
int  type_num 
)
Get a cast function to cast from the input descriptor to the
output type_number (must be a registered data-type). Returns NULL if un-successful.

References PyArray_ArrFuncs::cast, and _PyArray_Descr::f.

NPY_NO_EXPORT int PyArray_ObjectType ( PyObject *  op,
int  minimum_type 
)
End deprecated
Return the typecode of the array a Python object would be converted to

Referenced by new_array_for_sum().

NPY_NO_EXPORT int PyArray_ValidType ( int  type)
Is the typenum valid?