#12978: conditionally_defined decorator for methods and nested classes
-------------------------------------------------+-------------------------
Reporter: nthiery | Owner: jason
Type: enhancement | Status: new
Priority: major | Milestone: sage-
Component: misc | wishlist
Keywords: categories, | Resolution:
conditionally_defined | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------------------------+-------------------------
Comment (by SimonKing):
What about the documentation? Of course, if we have an instance x and a
conditionally defined method meth, then `x.meth` will be a specific
implementation, and we get its documentation. But what shall be the
documentation of `x.__class__.meth`?
In the simplest approach, it would be the documentation of the default
method.
In a less simple approach, it would prepend `"Conditionally defined
method: "` to the doc string of the one of the methods (I guess the
default is the method inherited from the super class).
In an even less simple approach, it would start with `"Conditionally
defined method, choosing from methods with the following documentation:"`,
followed by a concatenation of the doc string of the inherited method and
the specialised method. The inherited method might be conditional, too.
So, we might take care of nesting.
In the most complicated approach, we would even add the documentation of
the choosing function to the documentation of the wrapped methods.
--
Ticket URL: <http://trac.sagemath.org/ticket/12978#comment:6>
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 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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.