On Thu, Oct 21, 2010 at 12:18 PM, Pauli Virtanen <p...@iki.fi> wrote:

> Thu, 21 Oct 2010 11:03:52 -0600, Charles R Harris wrote:
> [clip]
> > I think the important thing to settle here is just how dtype comparisons
> > are supposed to work. The current implementation might well be intended
> > and if so we need to know why it is so. I'd like Travis to weigh in
> > here.
>
> To me it seems that sub-arrays were not considered in the initial
> implementation for `==`.
>
> I do not see reasons why one would want to have
>
>        a = dtype([('a', 'i1', (3, 3))])
>        b = dtype([('a', 'i1', 9)])
>        a == b
>
> In any case the current implementation is inconsistent, since currently
>
>        hash(a) != hash(b)
>
> However, I can see why one would want to have CanCastSafely to be true
> between these types.
>
>
Checking the shape seems like the right thing to do, I just want to be sure
that we aren't overlooking something. If we make the change will we need to
fix CanCastSafely?


>    ***
>
> The other issue of allowing broadcasting in sub-arrays --- it does not
> seem very useful to me. Unlike arrays, the dimensions of sub-arrays
> cannot be manipulated easily, and so many use-cases of broadcasting just
> disappear.
>
> Chuck
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to