The following curious bug came up during work on ticket #12233. For some
reason, if one creates a 2x2 integer matrix directly using the constructor
then it is possible to tell it to be immutable; but if one creates one via
arithmetic operations then calling "set_immutable" on it fails. Here's an
example:

 sage: from sage.matrix.matrix_integer_2x2 import Matrix_integer_2x2 as
 mi2x2
 sage: M2Z = MatrixSpace(ZZ,2)
 sage: mi2x2(M2Z, [1,0,0,1])
 sage: x=mi2x2(M2Z, [1,0,0,1], false, false)
 sage: y=mi2x2(M2Z, [1,0,0,1], false, false)
 sage: type(x)
 <type 'sage.matrix.matrix_integer_2x2.Matrix_integer_2x2'>
 sage: z = x*y
 sage: type(z)
 <type 'sage.matrix.matrix_integer_2x2.Matrix_integer_2x2'>
 sage: x.set_immutable()    # ok
 sage: z.set_immutable()    # error
[...]
AttributeError: 'NoneType' object has no attribute 'set_immutable'

(Many thanks to Timo Kluck for clarifying the problem and finding this
example.) Does anyone have any idea what's going on here, and if so how to
fix it?

Regards, David

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to