On Tue, Sep 11, 2018 at 5:30 PM Simon King <simon.k...@uni-jena.de> wrote:
>
> Hi Erik,
>
> On 2018-09-11, Erik Bray <erik.m.b...@gmail.com> wrote:
> > On Tue, Sep 11, 2018 at 9:57 AM Kwankyu Lee <ekwan...@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> I wonder why help on a method does not show the signature:
> >
> > ...
> > In the meantime I don't know that there's a satisfactory workaround
> > (some kind of Sage-specific solution using decorators to attach
> > signature documentation to methods might be a good idea, as would be
> > parsing it out of the docstring, though neither of these have been
> > implemented to my knowledge).
>
> Well, there is sage_getargspec, which is supposed to find the signature
> of *all* functions/methods in Sage. If it doesn't, I believe it's a bug.
> And in Kwankyu's example, it does:
>
>   sage: from sage.misc.sageinspect import sage_getargspec
>   sage: a = 17
>   sage: sage_getargspec(a.quo_rem)
>   ArgSpec(args=['self', 'other'], varargs=None, keywords=None, defaults=None)
>
> Actually I thought that `?` and `??` would use sage.misc.sageinspect
> rather than Python's "inspect" module, and I am surprised that
> apparently it doesn't.

Oh right, thank you for the reminder.  I could have sworn there *was*
something like that but I couldn't remember what it was.  I think it
works by parsing the Cython sources IIRC.  It still won't work, say,
for the built-in methods written in pure C, but there are few (if
any?) of those in Sage itself.

The ? interface I think still does very little if anything different
from its default behavior in IPython, and there are a few tickets I
can think of for improving that.  Would this be worth opening a ticket
for, assuming there isn't one already?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to