On Sun, Jul 31, 2011 at 12:50 AM, Hans Meine <
me...@informatik.uni-hamburg.de> wrote:

> Am 29.07.2011 um 20:23 schrieb Nathaniel Smith:
> > Even so, surely this behavior should be consistent between base class
> > ndarrays and subclasses? If returning 0d arrays is a good idea, then
> > we should do it everywhere. If it's a bad idea, then we shouldn't do
> > it at all...?
>
> Very well put.  That's exactly the reason why I am insisting on this
> discussion, and why I believe that the behavior change is not intentional.
>  Otherwise, ndarray and matrix should behave like my subclass.  (BTW: I did
> not check masked_array yet.)
>
> > (In reality, it sounds like this might be some mishap in the
> > __array_wrap__ mechanism?)
>
> That's exactly my guess.  (That could also explain why Mark did not see
> anything obvious in the code.)
>
>
Maybe. There isn't a problem for plain old zero dimensional arrays.

In [1]: a = array(1)

In [2]: a.dtype
Out[2]: dtype('int64')

In [3]: reshape(a, (1,1), order='f')
Out[3]: array([[1]])

This on Linux 64 with latest master.

Chuck
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to