[Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

Nathaniel Smith njs at pobox.com
Sun May 13 04:11:18 EDT 2012


On Sun, May 13, 2012 at 3:28 AM, Travis Oliphant <travis at continuum.io> wrote:
> Another approach would be to introduce a method:
>
> a.diag(copy=False)
>
> and leave a.diagonal() alone.  Then, a.diagonal() could be deprecated over
> 2-3 releases.

This would be a good idea if we didn't already have both
np.diagonal(a) (which is an alias for a.diagonal()) *and* np.diag(a),
which do different things. And the new a.diag() would be different
from the existing np.diag(a)...

-- Nathaniel



More information about the NumPy-Discussion mailing list