#6097: [with patch, needs review] Implements a mantra for declaring abstract
methods
-------------------------+--------------------------------------------------
Reporter: nthiery | Owner: nthiery
Type: enhancement | Status: assigned
Priority: major | Milestone: sage-4.1
Component: misc | Keywords: abstract methods
Reviewer: | Author: nthiery
Merged: |
-------------------------+--------------------------------------------------
Comment(by nthiery):
Replying to [comment:15 saliola]:
> Here is a second opinion.
> I really, really like the idea of adding such a decorator! And for the
> record, under normal circumstances, I would have asked for a full design
> discussion to take place on sage-devel since I share many of the above
> concerns and because I think that there are many subtle design issues
> that need to be addressed. (We'll have to have that discussion later,
> it seems.)
I tried to advertise the feature to start such a discussion, but there was
not much reaction. I think we first need to accumulate experience by using
the current thing, and then discuss again. Release early, release often.
> However, in light of the decision to get the category theory
> code into Sage quickly, I am going to reluctantly suggest it be
> included in Sage as is.
Thanks.
> Here is a list of things that I don't like (most have been mentioned
above):
>
> - raising {{{NotImplementedError}}} when an abstract method is accessed
> - the error message is not useful
> - returning {{{NotImplemented}}} for an optional abstract class
> - can't access the documentation for an abstract method
> - that {{{hasattr(x, 'my_method')}}} returns False for abstract methods
> and True for optional abstract methods
> - can't determine what the undefined abstract methods of an object are
Thanks for the feedback! I am also not yet happy about the current state.
So do you have suggestions for what to return in both cases?
What mantra would you like to see to test whether an optional abstract
method has, or not,
been implemented?
Feel free to include those suggestions in the doc via a reviewers patch,
so that users run into them in the future.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6097#comment:16>
Sage <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---