On Wed, 17 May 2017, Vincent Delecroix wrote:
An example is given by "is_cyclotomic" that returns either a boolean or
an integer
sage: x = polygen(ZZ)
sage: p = x^2 + x + 1
sage: p.is_cyclotomic()
True
sage: p.is_cyclotomic(certificate=True)
3
I suggest that certificate=True always returns a pair (i.e. a tuple of two
elements) where first value is True or False, and the second value is the
certificate or None.
But that won't make the question about docstring easier. What to do if
INPUT and OUTPUT are strongly related? See for example
automorphism_group() of a graph.
--
Jori Mäntysalo