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().