There is a module in Sage, sage.sandpiles.sandpile [1] where all the
classes defined therein define a .help() method that prints an
actually pretty nice looking summary of the class's methods.  The
implementation of that method has some issues and is repeated almost
verbatim for each class (which I fixed here [2]) but that's beside the
point.

Most other classes in Sage do *not* have any such .help() method.  The
only other examples I could find were a couple classes in
sage.lfunctions, and most of the sage.interfaces classes.  Why this
was added for sandpiles I have no idea--maybe it was originally a
separate package from Sage.

But it got me thinking: Maybe it would actually be nice if most Sage
classes--or at least those inheriting from SageObject, had some
version of this .help() method.  Although we already do a decent job
advertising the ? and ?? syntax, having  .help() method is inherently
more discoverable (an the help methods in sandpiles even advertise the
? syntax for further details).

In principle, if classes had this, one might also want it for
functions, but that's a little bit more problematic.  I like the idea
of moving this .help() method to SageObject though.  What do you all
think?

Thanks,
E


[1] https://git.sagemath.org/sage.git/tree/src/sage/sandpiles/sandpile.py
[2] https://trac.sagemath.org/ticket/26016

-- 
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