Re: [Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-23 Thread David Cournapeau
On Wed, Feb 10, 2010 at 3:12 PM, David Cournapeau wrote: > Hi, > > I am a bit puzzled by the protocol for long(a) where a is a scalar > array. For example, for a = np.float128(1), I was expecting long(a) to > call a.__long__, but it does not look like it is the case. int(a) does > not call a.__int

Re: [Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-10 Thread Pauli Virtanen
ti, 2010-02-09 kello 23:28 -0700, Charles R Harris kirjoitti: [clip] > I'm curious if np.long the same as long? np.long is long I'm not sure if this was always so, since ticket #99's test cases try to check that np.long works properly. Pauli

Re: [Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-09 Thread David Cournapeau
Charles R Harris wrote: > > > On Tue, Feb 9, 2010 at 11:12 PM, David Cournapeau > wrote: > > Hi, > > I am a bit puzzled by the protocol for long(a) where a is a scalar > array. For example, for a = np.float128(1), I was expecting long(a) to > call a._

Re: [Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-09 Thread Charles R Harris
On Tue, Feb 9, 2010 at 11:12 PM, David Cournapeau wrote: > Hi, > > I am a bit puzzled by the protocol for long(a) where a is a scalar > array. For example, for a = np.float128(1), I was expecting long(a) to > call a.__long__, but it does not look like it is the case. int(a) does > not call a.__int

[Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-09 Thread David Cournapeau
Hi, I am a bit puzzled by the protocol for long(a) where a is a scalar array. For example, for a = np.float128(1), I was expecting long(a) to call a.__long__, but it does not look like it is the case. int(a) does not call a.__int__ either. Where does the long conversion happen in numpy for scalar