On Thu, Jan 15, 2015 at 9:44 AM, Maniteja Nandana <maniteja.modesty067@gmail.com> wrote:
Hello everyone,

I just wanted to highlight the point made by Charles, it would be great if he would clarify any mistakes in the points that I put forward.

Quoting the documentation,
In versions of NumPy prior to 1.7, this function always returned a new,independent array containing a copy of the values in the diagonal.

    In NumPy 1.7 and 1.8, it continues to return a copy of the diagonal,but depending on this fact is deprecated. Writing to the resulting array continues to work as it used to, but a FutureWarning is issued.

    In NumPy 1.9 it returns a read-only view on the original array. Attempting to write to the resulting array will produce an error.

    In NumPy 1.10, it will return a read/write view, Writing to the returned array will alter your original array.
Though the expected behaviour has its pros and cons,the points put forward are :
  1. revert the changes so that PyArray_Diagonal returns a copy.
  2. introduce new API function PyArray_Diagonal2, which has a copy argument, so that copy or view can be returned.
  3. if a view is to be returned, its write-ability depends on whether the input is writeable.
  4. implement PyArray_Diagonal in terms of the new function, thought the default value of copy is unsure. 
copy=True
  1. Raise a FutureWarning, when trying to write to the result.
Old function should behave exactly as before, returning a writable copy. 
  1. add copy argument to the diagonal function and method, updating the function in methods.c and fromnumeric.py, probably in other places also.
  2. Also update the release notes and documentation.
I would love to do the PR once a decision is reached.

Chuck