Hi Volker, hi in general, On 2013-09-13, Volker Braun <[email protected]> wrote: > Hence, is_unit() should probably be part of on RingElement unless we mean > by=20 > RingElement just an element with multiplication and addition (in which case= >=20 > it is really badly named TM).=20
I think you miss one point here. Of course, it make sense that RingElement provides is_unit(). But one must not forget that there are rings whose elements are not using RingElement for a reason. The classical example are matrix spaces. Generally, matrix spaces are modules, and thus its elements should inherit from ModuleElement (I think they do!). But if the matrix space happens to be quadratic, then it is a ring. Do we really want to create two separate implementation for matrix spaces and their elements, one for the quadratic and one for the non-quadratic case? It seems much more natural to me (in this an other cases) to have generic implementations of methods in the category framework, and not only in the arithmetic base classes. > e.g. if your programming language doesn't support multiple inheritance.=20 > That isn't really an issue in Python, but it is in Cython. Though it=20 > doesn't seem to be the problem in your case. Actually it *can* be a problem even in a Python class inheriting from two Cython classes. Namely, I once tried to create a class that inherited (if I recall correctly) from both from Map (or Morphism) and RingElement. But then, due to a bug probably in Cython, cdef attributes of the two base classes got confused. That's to say, a method inherited from RingElement wanted to access a cdef attribute of RingElement, but got a cdef attribute from Map instead! Best regards, Simon -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.
