[NumPy-Tickets] [NumPy] #2075: Writing to a transpose results in strange error
NumPy Trac
numpy-tickets@scipy....
Tue Mar 6 23:02:39 CST 2012
#2075: Writing to a transpose results in strange error
-------------------------------------------------+--------------------------
Reporter: lxop | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: 1.6.1
Keywords: Transpose, writable, AttributeError |
-------------------------------------------------+--------------------------
When I try to write to the transpose of an array, I get
{{{AttributeError: attribute 'T' of 'numpy.ndarray' objects is not
writable}}}
which seems fine, but the write _has_ actually taken place.
In particular, this occurs with in-place operations (+= etc).
Test code:
{{{
a = np.array ([1,2,3]).reshape ((1,3))
b = np.array ([4,5,6]).reshape ((3,1))
a.T += b
}}}
The result is the above error is raised and the operation actually goes
ahead anyway. I would expect only one or the other.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2075>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list