I am using the maths package SAGE, which is written in Python.
I am trying to manipulate some sets of vectors and I keep on getting the above error message. I have absolutely no idea what it is telling me, although I do understand what mutable means Can someone please explain in fairly simple conceptual terms what it is telling me is wrong?
It means that Python cannot use the content of ‘vectors’ to build a set, because the ‘vector object’ is just a ‘pointer’ to its content: the content is not ‘fixed’ and you can change it re-using the same vector vatiable (Python would have to rebuild the set to keep it working).
So, you can use ‘set’ only of immutable objects (like tuples, strings, numbers).
E.g.
This is because you can change l1 and l2 (e.g. with .append).
In this case you cannot change the content of t1 and t2.