On Tue, Jun 7, 2011 at 5:14 PM, Gonzalo Tornaria <[email protected]> wrote: > On Tue, Jun 7, 2011 at 5:18 PM, Simon King <[email protected]> wrote: >> Hi Gonzalo, >> >> On 7 Jun., 21:25, Gonzalo Tornaria <[email protected]> wrote: >>> What is the base class that one is supposed to use instead of >>> ParentWithBase? >> >> I think it is Parent. The Parent.__init__ accepts an argument base. >> >> Here is a small example: > > Thanks for the example. I'll try it. > > One caveat, though. The standard "Ring" and "Algebra" parents both > inherit from the ParentWithBase. Am I allowed to mix an element class > derived from AlgebraElements with a parent class derived from Parent?
I can't say for sure that there aren't any hidden assumptions, but I don't think the Parent's class hierarchy constrains the Element's. > Also, is it my impression or this model seems to require a lot of > boilerplate if I wanted to implement it fully (with categories, > functors, etc)? I've tried to limit the amount of boilerplate one needs to write. For example, if a category is not given, it will guess one for you (often Sets). You simply have to declare that a coercion exists and it will create the Morphisms for you. You've read http://www.sagemath.org/doc/reference/coercion.html I presume? Not much, but probably the best we have. - Robert -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
