# Ticket #9239: trac_9239-matrix_copy_remove-fh.patch

File trac_9239-matrix_copy_remove-fh.patch, 1.7 KB (added by hivert, 11 years ago)
• ## sage/matrix/matrix0.pyx

```# HG changeset patch
# User Florent Hivert <Florent.Hivert@univ-rouen.fr>
# Date 1276560701 -7200
# Node ID 473e449d9e43bd165bfe0ff4c4a2a82fecdb7f52
# Parent  5ff63bd154529813df142719943a2d57b179eed0
#9239: remove wrong __copy__ method in matrix0.pyx

diff --git a/sage/matrix/matrix0.pyx b/sage/matrix/matrix0.pyx```
 a cdef class Matrix(sage.structure.element sage.misc.misc.deprecation("the .copy() method is deprecated; please use the copy() function instead, for example, copy(M)") return self.__copy__() def __copy__(self): """ Make a copy of self. If self is immutable, the copy will be mutable. .. warning:: The individual elements aren't themselves copied (though the list is copied). This shouldn't matter, since ring elements are (almost!) always immutable in Sage. EXAMPLES:: sage: R. = QQ['x'] sage: a = matrix(R,2,[x+1,2/3,  x^2/2, 1+x^3]); a [  x + 1     2/3] [1/2*x^2 x^3 + 1] sage: b = copy(a) sage: b[0,0] = 5 sage: b [      5     2/3] [1/2*x^2 x^3 + 1] sage: a [  x + 1     2/3] [1/2*x^2 x^3 + 1] :: sage: b = copy(a) sage: f = b[0,0]; f[0] = 10 Traceback (most recent call last): ... IndexError: polynomials are immutable """ return self.__copy__() def list(self): """ List of the elements of self ordered by elements in each