2.9 Mutability

Parent structures (e.g., rings, fields, matrix spaces, etc.) should be immutable and globally unique whenever possible. Immutability includes making it so properties like generator labels and default coercion precision cannot be changed.

Global uniqueness while not wasting space storing objects that are not being referenced is best implemented using the standard Python weakref module, a factory function, and module scope variable.

.

Certain objects, e.g., matrices, may start out mutable and become immutable later. See the file SAGE_ROOT/devel/sage/sage/structure/mutability.py.

See About this document... for information on suggesting changes.