There is sage.structure.mutability.Mutability to inherit from. It seems
the this class is not used; at least using grep [1] to search for
"Mutability" gives just two files (sage/matrix/matrix0.pyx and
sage/matrix/matrix_integer_2x2.pyx), where this class is imported. It
seems that commenting out the import-lines in those two files does not
change anything (no error messages at all; all doctests are still
passed). grepping for "structure.mutability", see [2], also does not
give anything.
So, are there classes, where sage.structure.mutability.Mutability is used?

Further, the code in mutability.pyx seems to be outdated. Comparing the
code to the one in sequence.py gives (for example):
  mutability.pyx:45  self._is_immutable = 1
  sequence.py:       self._is_immutable = True
or a missing "return" in is_immutable. (I noticed those things by just
looking at the code in mutability.pyx; probably, comparing those files
really would bring more...)

Anyhow, a lot of classes implement mutability by themselves, see [3].

Are there already trac-tickets for those things? (if not I'll open some...)

The reason, why I looked at this, is, that it was mentioned in a comment
on #15078 to use Mutability for the FiniteStateMachine-class.

Daniel


[1] sage -grep "Mutability"

sage/homology/simplicial_complex.py:Mutability (see :trac:`12587`)::
sage/matrix/matrix0.pyx:from   sage.structure.mutability cimport Mutability
sage/matrix/matrix0.pyx:    # Mutability and bounds checking
sage/matrix/matrix_integer_2x2.pyx:from sage.structure.mutability
cimport Mutability
sage/structure/mutability.pyx:Mutability Cython Implementation
sage/structure/mutability.pyx:cdef class Mutability:
sage/structure/mutability.pyx:        return Mutability,
(self._is_immutable, )
sage/structure/all.py:from mutability  import Mutability
sage/structure/sequence.py:#from mutability import Mutability #we cannot
inherit from Mutability and list at the same time
sage/libs/gap/gap_functions.py:  'OneSameMutability',
sage/libs/gap/gap_functions.py:  'ZeroSameMutability',


[2] sage -grep -i "structure.mutability"

sage/matrix/matrix0.pyx:from   sage.structure.mutability cimport Mutability
sage/matrix/matrix_integer_2x2.pyx:from sage.structure.mutability
cimport Mutability
sage/structure/mutability.pyx:        sage: from
sage.structure.mutability import require_mutable, require_immutable
sage/structure/mutability.pyx:        sage: from
sage.structure.mutability import require_mutable, require_immutable


[3] sage -grep "def is_immutable"

sage/modules/free_module_element.pyx:    def is_immutable(self):
sage/homology/simplicial_complex.py:    def is_immutable(self):
sage/matrix/matrix0.pyx:    def is_immutable(self):
sage/structure/mutability.pyx:    def is_immutable(self):
sage/structure/sequence.py:    def is_immutable(self):
sage/libs/ppl.pyx:    def is_immutable(self):

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to