Skip to content

Commit

Permalink
src/sage/libs/singular/function.pyx: use new get_docstring() features
Browse files Browse the repository at this point in the history
The rewritten get_docstring() in sage.interfaces.singular supports
formatting the output as reStructuredText, so we no longer need to
do it "by hand" in the library interface.
  • Loading branch information
orlitzky committed Nov 8, 2024
1 parent 8dfdf74 commit 0127125
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/sage/libs/singular/function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ cdef class SingularFunction(SageObject):
sage: from sage.libs.singular.function import singular_function
sage: groebner = singular_function('groebner')
sage: 'groebner' in groebner.__doc__
sage: 'groebner' in groebner.__doc__ # needs info
True
"""

Expand Down Expand Up @@ -1360,14 +1360,9 @@ EXAMPLES::
[x2, x1^2],
[x2, x1^2]]
The Singular documentation for '%s' is given below.
"""%(self._name,self._name)
# Github issue #11268: Include the Singular documentation as a block of code
singular_doc = get_docstring(self._name).split('\n')
if len(singular_doc) > 1:
return prefix + "\n::\n\n"+'\n'.join([" "+L for L in singular_doc])
else:
return prefix + "\n::\n\n"+" Singular documentation not found"
"""%(self._name)
from sage.interfaces.singular import get_docstring
return prefix + get_docstring(self._name, prefix=True, code=True)

cdef common_ring(self, tuple args, ring=None):
"""
Expand Down

0 comments on commit 0127125

Please sign in to comment.