[Numpy-discussion] Automatic custom dtype
Charles R Harris
charlesr.harris at gmail.com
Fri Jun 21 14:57:50 EDT 2013
On Fri, Jun 21, 2013 at 12:53 PM, Charles R Harris <
charlesr.harris at gmail.com> wrote:
>
>
> 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.
>
>
You could check the numpy/core/src/umath/test_rational.c.src code to see if
you are missing something.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130621/90b1f688/attachment.html>
More information about the NumPy-Discussion
mailing list