#9976: Decorated functions/methods have generic signature in documentation
--------------------------------+-------------------------------------------
Reporter: jsrn | Owner: mvngu
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.7
Component: documentation | Keywords: sphinx, documentation, cython
inspection
Author: jsrn, Simon King | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Comment(by SimonKing):
Replying to [comment:36 jsrn]:
> I already hit the first snag as I misremembered my patch (because I
originally had two possible solutions): the _sage_getargspec I defined is
a function taking a "getter" function, which is a function able to
construct the argspec of an object. When called by
sage_autodoc.format_args, the getter will be a local function in there,
resulting in a recursive interplay between whatever is in _sage_getargspec
and format_args. This is to avoid copying all the logic in sage_autodoc
for how to produce argspecs for different "basic" objects.
In other words, the purpose of `_sage_getargspec` and `_sage_argspec_` is
different: If an object knows its arguments, then it can simply return
them with `_sage_argspec_`. Otherwise, the interplay between sage_autodoc
and the getter method of `_sage_getargspec` will find out.
I try to imagine what objects do not know their own arguments. Is it like
this? If the object is in fact not a class instance but a class, then
calling a method like `_sage_argspec_` would result in a type error. So,
_sage_argspec_ would not be able to tell the arguments of a class.
However, the arguments of a class are the arguments of its `__new__` or
`__init__` method -- and both are actually considered in
sage.misc.sageinspect.sage_getargspec.
So, is the purpose of `_sage_getargspec` and its getter method to deal
with the case of a class, or what situation did you have in mind when you
invented it?
What would `_sage_getargspec` and its getter method be able to do that
`sage_getargspec` (after my patch) can not do?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9976#comment:38>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.