On Tue, Oct 28, 2014 at 10:11 PM, Nathaniel Smith <n...@pobox.com> wrote:

> > I don't think so - I think all the heavy lifting is already done in
> flatiter.  The missing parts are mostly trivial things like .size or .shape
> or can be fudged by coercing to true ndarray using existing
> flatiter.__array__ method.
>
> Now try .resize()...
>

Simple:

def resize(self, shape):
    if self.shape == shape:
        return
    else:
        raise ValueError


>From ndarray.resize documentation:

Raises
------
ValueError
    If `a` does not own its own data or references or views to it exist,
    and the data memory must be changed.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to