#17847: Cython: embed signatures in docstrings of Sage library code
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.6
Component: cython | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer, | Reviewers: Simon King
Simon King | Work issues:
Report Upstream: Fixed upstream, | Commit:
but not in a stable release. | 19135c15db9122693b8d8d023fe59749eb1a1d64
Branch: | Stopgaps:
u/SimonKing/ticket/17847 |
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Aha! `sage.graphs.isgci.graph_classes.__init__` is obtained from
`object.__init__` (even though
`sage.graphs.isgci.graph_classes.__init__==object.__init__` returns
False), and the docstring of `sage.graphs.isgci.graph_classes` is empty.
Since the doc of the inherited init method is then used (with my not-yet-
commited changes), it is also attempted to insert the argspec of
`sage.graphs.isgci.graph_classes`. And big surprise:
{{{
sage: callable(sage.graphs.isgci.graph_classes)
False
sage: callable(object)
True
}}}
Since `sage.graphs.isgci.graph_classes` surprisingly isn't callable,
`sage_getargspec` raises an error.
In any case, I think it is slightly cleaner to use `obj.__init__.__doc__`
only if obj is a class, `obj.__doc__` is essentially empty (up to
embedding information), '''and''' if `obj.__init__.__objclass__==obj`.
--
Ticket URL: <http://trac.sagemath.org/ticket/17847#comment:71>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.