On 2018-08-09 14:54, Erik Bray wrote:
In principle, if classes had this, one might also want it for functions, but that's a little bit more problematic.
I think that's already a bit problematic: whether something is a class or a function should really be an implementation detail. For example, there are quite a few important constructor functions in Sage such as Matrix() or PolynomialRing().
But adding a help "method" for functions shouldn't be too hard actually. Non-built-in functions have a __dict__ so you could add a help attribute (it wouldn't be a method strictly speaking). And I guess that things were you care about help() are high-level enough that the performance regression of making them non-built-in is acceptable.
You could use the decorator syntax to have a common syntax both for functions and methods.
Just an idea... Jeroen. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
