[Numpy-discussion] Equality of dtypes does not imply equality of type kinds

Maniteja Nandana maniteja.modesty067 at gmail.com
Mon Jan 12 14:14:11 EST 2015


Hi,

On Tue, Jan 13, 2015 at 12:03 AM, Alexander Belopolsky <ndarray at mac.com>
wrote:

> Consider this (on a 64-bit platform):
>
> >>> numpy.dtype('q') == numpy.dtype('l')
> True
>
>
>>> numpy.dtype('q').char == numpy.dtype('l').char
> False
>
> Is that intended?  Shouldn't dtype constructor "normalize" 'l' to 'q' (or
> 'i')?
>
>
'q' is defined as NPY_LONGLONGLTR, while 'l' is NPY_LONGLTR [here]
<https://github.com/numpy/numpy/blob/maintenance/1.9.x/numpy/core/include/numpy/ndarraytypes.h#L102>
.
Similar issue was raised on Issue 5426
<https://github.com/numpy/numpy/issues/5426#issuecomment-68942373>. Even I
am not aware of the exact reason, but hope it helps.
Also,

>>> numpy.dtype('q').num
9
>>> numpy.dtype('l').char
7
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion at scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

_______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150113/8e505656/attachment.html>


More information about the NumPy-Discussion mailing list