[Numpy-discussion] Automatic custom dtype

Charles R Harris charlesr.harris at gmail.com
Fri Jun 21 14:53:03 EDT 2013


On Fri, Jun 21, 2013 at 9:18 AM, Richard Hattersley
<rhattersley at gmail.com>wrote:

> 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?
>
>
Hmm, that part looks ok.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130621/33ffc640/attachment.html>


More information about the NumPy-Discussion mailing list