Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think this is just a bug

sage: A=matrix(GF(2),[[1,0],[0,1]])
sage: B=matrix(ZZ,[[1,0],[0,1]])
sage: A.set_immutable()
sage: B.set_immutable()
sage: loads(dumps(A)).is_immutable()
sage: loads(dumps(B)).is_immutable()

Clearly, matrices over GF(2) do not preserve their immutability upon pickle/unpickle. The bug seems specific to matrices over GF(2) [which indeed have a separate optimized implementation]