[Numpy-discussion] Automatic custom dtype

Richard Hattersley rhattersley at gmail.com
Fri Jun 21 11:18:27 EDT 2013


On 21 June 2013 14:49, Charles R Harris <charlesr.harris at gmail.com> wrote:
> Bit short on detail here ;) How did you create/register the dtype?

The dtype is created/registered during module initialisation with:
    dtype = PyObject_New(PyArray_Descr, &PyArrayDescr_Type);
    dtype->typeobj = &Time360Type;
    ...
    PyArray_RegisterDataType(dtype)

Where Time360Type is my new type definition:
    static PyTypeObject Time360Type = { ... }
which is initialised prior to the dtype creation.

If the detail matters then should I assume this is unexpected
behaviour and maybe I can fix my code so it works?

Richard



More information about the NumPy-Discussion mailing list