signature missing in introspection some of the time

51 views
Skip to first unread message

John H Palmieri

unread,
Jul 20, 2019, 12:32:24 PM7/20/19
to sage-devel

   blah?

the signature is not present. Is this a bug or is it intended?

I like this behavior:

sage: A = SteenrodAlgebra()
sage
: A.antipode?
Signature:      B.antipode(self, *args)
Call signature: B.antipode(*args)
Type:           ModuleMorphismByLinearity_with_category
String form:    Generic endomorphism of mod 2 Steenrod algebra, milnor basis
File:           ~/Desktop/Sage_stuff/git/sage/local/lib/python2.7/site-packages/sage/modules/with_basis/morphism.py
Docstring:    

   
...

but not this:

sage: mat = random_matrix(ZZ, 3, 3)
sage
: mat.add_multiple_of_row?
Docstring:    
   
...



--
John

Travis Scrimshaw

unread,
Jul 21, 2019, 3:44:37 AM7/21/19
to sage-devel
Maybe a difference between Python and Cython classes?

Best,
Travis

Simon King

unread,
Jul 21, 2019, 4:45:42 AM7/21/19
to sage-...@googlegroups.com
On 2019-07-21, Travis Scrimshaw <tsc...@ucdavis.edu> wrote:
> Maybe a difference between Python and Cython classes?

If I recall correctly, Cython can be made to embed information
into the docstring, because otherwise that information wouldn't be
accessible. And with Python classes that information is directly
available from the class, no need to embed the information.

The stuff in sage.misc.sageinspect relies on it (and strips the
embedded information, if I recall correctly, when doing "stuff?").

Best regards,
Simon

Kwankyu Lee

unread,
Jul 21, 2019, 6:44:24 AM7/21/19
to sage-devel
There is already a ticket for that:


but no one is working on it.

Kwankyu Lee

unread,
Jul 22, 2019, 6:38:00 AM7/22/19
to sage-devel
Now there is a one-line patch at


to fix the problem.

I wish that cython experts check that out. I am concerned whether the patch has any unexpected side effect that I cannot foresee.
Reply all
Reply to author
Forward
0 new messages