trac #15622: Immutable graphs must not be relabeled
trac #15622: More informative exception message
Trac 15622: Review commit, fixing a misspelled doctest
Trac #15192: add is_unit() for residue fields

Currently, residue fields have no `is_unit`:
{{{
sage: K.<z> = CyclotomicField(7)
sage: P = K.factor(17)[0][0]
sage: ff = K.residue_field(P)
sage: a = ff(z)
sage: a.is_unit()
NotImplementedError
}}}

They are fields but the implementation from `Fields.ElementMethods` is
not used because the generic ring class defines a trivial `is_unit()`
already. This ticket moves that method to the category of rings which
gives a working `is_unit()` for residue fields.

URL: http://trac.sagemath.org/15192
Reported by: saraedum
Ticket author(s): Julian Rueth
Reviewer(s): David Roe
Trac #15622: Immutable graphs must not be relabeled

Now
{{{
sage: Graph(graphs.PetersenGraph(), immutable=True).relabel({})
...
ValueError: Thou shalt not relabel an immutable graph
}}}

Before, the following happened
{{{
sage: Graph(graphs.PetersenGraph(),
data_structure="static_sparse").relabel({})
...
AttributeError: 'StaticSparseBackend' object has no attribute
'vertex_ints'
}}}

This is actually another bug, as there should be a `vertex_ints`
variable in static sparse graphs. But that's another problem to be
addressed in another ticket `:-P`

Nathann

URL: http://trac.sagemath.org/15622
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Simon King