[Numpy-discussion] numpy type mismatch

Pauli Virtanen pav at iki.fi
Fri Jun 10 22:00:24 EDT 2011


On Fri, 10 Jun 2011 19:35:30 -0600, Charles R Harris wrote:
[clip]
> Maybe yes, maybe no ;) They have different descriptors, so from numpy's
> perspective they are different, but at the hardware/precision level they
> are the same. It's more of a decision as to what  != means in this case.
> Since numpy started as Numeric with only the c types the current
> behavior is consistent, but that doesn't mean it shouldn't change at
> some point.

IMO, Numpy should not have unnecessary scalar Python types in play.
Having dtypes with different equivalent chars is not so bad, since
they compare equal -- the scalar types don't.

This could possibly be resolved by adjusting multiarraymodule so
that it registers only one scalar type per size, according to what
it sees at compile time. One issue is that the scalar types are
global structs, and not pointers, so it's not so easy to make
one point to another. Maybe they can be memcpy'd to make aliases,
although that sounds dirty...

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list