On 15/01/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > Since the point of output arguments is to avoid allocating new > > storage, > > > If we take that seriously, then an error should be raised on a shape, or > type mismatch.
In fact: In [10]: a = zeros(3) In [11]: b = zeros(4,dtype=uint8) In [12]: add(a,a,b) --------------------------------------------------------------------------- exceptions.ValueError Traceback (most recent call last) /home/peridot/<ipython console> ValueError: invalid return array shape In [13]: add(a,a,b[:3]) Out[13]: array([0, 0, 0], dtype=uint8) In [14]: add(b,b,b.reshape((2,2))) --------------------------------------------------------------------------- exceptions.ValueError Traceback (most recent call last) /home/peridot/<ipython console> ValueError: invalid return array shape We do raise an error on shape mismatch; type mismatches are used to forcibly cast the result - which is useful! So I'd say we take it seriously. It's one of the ways to make your code run faster. A. M. Archibald _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion