3.5 Mutability

Parent structures (e.g., rings, fields, matrix spaces, etc.) should be immutable and globally unique whenever possible. Immutability means, among other things, that properties like generator labels and default coercion precision cannot be changed.

Global uniqueness while not wasting memory 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.