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

Charles R Harris charlesr.harris@gmail....
Wed Feb 10 00:28:39 CST 2010


On Tue, Feb 9, 2010 at 11:12 PM, David Cournapeau <cournape@gmail.com>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__ either. Where does the long conversion happen in
> numpy for scalar arrays ?
>
>
How did you tell, did you have print statements in the call? I'm curious if
np.long the same as long?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100209/6fb3ac00/attachment.html 


More information about the NumPy-Discussion mailing list