Dear all,

I went into the following bug: it is possible to modify an entry of vector whose parent is a submodule of R^n.

sage: V = VectorSpace(QQ, 3)
sage: M = V.subspace([(1,0,0,),(0,1,0)])
sage: v = M()
sage: v
(0, 0, 0)
sage: v[2] = 2 # bug
sage: v
(0, 0, 2)
sage: v.parent() is M
True

I opened https://trac.sagemath.org/ticket/22075 but I am not sure about the solution. I see at least 2

 1) forbid __setitem__
2) check when a modification is done that the vector still belongs to the given submodule (possibly together with a __enter__/__exit__ hook)

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to