numpy 2.0.0
src/multiarray/descriptor.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT PyObject * arraydescr_protocol_typestr_get (PyArray_Descr *)
NPY_NO_EXPORT PyObject * arraydescr_protocol_descr_get (PyArray_Descr *self)
NPY_NO_EXPORT PyObject * array_set_typeDict (PyObject *NPY_UNUSED(ignored), PyObject *args)
NPY_NO_EXPORT PyArray_Descr_arraydescr_fromobj (PyObject *obj)
NPY_NO_EXPORT PyObject * arraydescr_short_construction_repr (PyArray_Descr *dtype)

Function Documentation

NPY_NO_EXPORT PyArray_Descr* _arraydescr_fromobj ( PyObject *  obj)

Understand basic ctypes
derived type
Understand ctypes structures --
bit-fields are not supported automatically aligns

NPY_NO_EXPORT PyObject* array_set_typeDict ( PyObject *  NPY_UNUSEDignored,
PyObject *  args 
)

Decrement old reference (if any)
Create an internal reference to it

NPY_NO_EXPORT PyObject* arraydescr_protocol_descr_get ( PyArray_Descr self)
NPY_NO_EXPORT PyObject* arraydescr_protocol_typestr_get ( PyArray_Descr )
NPY_NO_EXPORT PyObject* arraydescr_short_construction_repr ( PyArray_Descr dtype)
This creates a shorter repr using the 'kind' and 'itemsize', instead of the longer type name. It also creates the input for constructing a dtype rather than the full dtype function call.
This does not preserve the 'align=True' parameter for structured arrays like the regular repr does.
This creates a shorter repr using 'kind' and 'itemsize', instead of the longer type name. This is the object passed as the first parameter to the dtype constructor, and if no additional constructor parameters are given, will reproduce the exact memory layout.
This does not preserve the 'align=True' parameter or sticky NPY_ALIGNED_STRUCT flag for struct arrays like the regular repr does, because the 'align' flag is not part of first dtype constructor parameter.

Normalize byteorder to '<' or '>'
Handle booleans, numbers, and custom dtypes
All the rest which don't fit in the same pattern
The object reference may be different sizes on different platforms, so it should never include the itemsize here.

References descr_length(), and descr_subscript().