Re: [Numpy-discussion] Automatic custom dtype

2013-06-21 Thread Charles R Harris
On Fri, Jun 21, 2013 at 12:53 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Fri, Jun 21, 2013 at 9:18 AM, Richard Hattersley > wrote: > >> On 21 June 2013 14:49, Charles R Harris >> wrote: >> > Bit short on detail here ;) How did you create/register the dtype? >> >> The dtype

Re: [Numpy-discussion] Automatic custom dtype

2013-06-21 Thread Charles R Harris
On Fri, Jun 21, 2013 at 9:18 AM, Richard Hattersley wrote: > On 21 June 2013 14:49, Charles R Harris 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, &PyAr

Re: [Numpy-discussion] Automatic custom dtype

2013-06-21 Thread Richard Hattersley
On 21 June 2013 14:49, Charles R Harris 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; ... PyArra

Re: [Numpy-discussion] Automatic custom dtype

2013-06-21 Thread Charles R Harris
On Fri, Jun 21, 2013 at 7:09 AM, Richard Hattersley wrote: > Hi all, > > In my continuing adventures in the Land of Custom Dtypes I've come > across some rather disappointing behaviour in 1.7 & 1.8. > > I've defined my own class `Time360`, and a corresponding dtype > `time360` which references Tim

[Numpy-discussion] Automatic custom dtype

2013-06-21 Thread Richard Hattersley
Hi all, In my continuing adventures in the Land of Custom Dtypes I've come across some rather disappointing behaviour in 1.7 & 1.8. I've defined my own class `Time360`, and a corresponding dtype `time360` which references Time360 as its scalar type. Now with 1.6.2 I can do: >>> t = Time360(2013,