Ticket #2377 (closed defect: fixed)
[with patch, with positive review] Bugfix for the new __copy__ method of SingularElement
|Reported by:||SimonKing||Owned by:||was|
In sage-2.10.3.rc0, the following example would produce a traceback when copying the quotient ring Q. With the patch, it works.
sage: R=singular.ring(0,'(x,y)','dp') sage: L=R.ringlist() sage: L=singular.ideal('x**2-5') sage: Q=L.ring() sage: otherR=singular.ring(5,'(x)','dp') sage: cpQ=copy(Q) sage: cpQ.set_ring() sage: cpQ // characteristic : 0 // number of vars : 2 // block 1 : ordering dp // : names x y // block 2 : ordering C // quotient ring from ideal _=x^2-5
The bug consists in the following: In __copy__, ringlist is called. In the case of quotient rings or non-commutative rings, ringlist contains polynomial data. Hence, it is invalid if the current ring (here: otherR) does not fit.
Solution: With the patch, __copy__ applied to a ring or quotient ring Q first makes Q active, then produces a copy of Q, returns to the previously active ring, and provides the copy of Q.
- Summary changed from [with patch, needs review] Bugfix for the new __copy__ method of SingularElement to [with patch, with positive review] Bugfix for the new __copy__ method of SingularElement