This is a bug, elements should always be of the type Parent.element_class. The element constructor right now is
def _element_constructor_(self, x): """ TESTS:: sage: B = BraidGroup(4) sage: B([1, 2, 3]) # indirect doctest s0*s1*s2 """ return Braid(self, x) but it should call self.element_class(self, x) instead. DL;DR: Always use element_class and not the Element subclass that you wrote. This is also important for inheritance, you might want to subclass SuperBraid(Braid) and then it would suck to have all methods return base class Braids. On Saturday, June 7, 2014 2:04:51 PM UTC+1, mmarco wrote: > > I have found the following behaviour: > > {{{ > sage: B=BraidGroup(4) > sage: b=B([1,2,3]) > sage: type(b) > <class 'sage.groups.braid.Braid'> > sage: type(b*b) > <class 'sage.groups.braid.BraidGroup_class_with_category.element_class'> > }}} > > Both b and b*b have the same parent, but they belong to different classes. > I guess that the fact that they are constructed by different methods > (BraidGroup.__call__ vs, BraidGroupElement.__mul__) is responsible for this. > > Should this be corrected or is it the normal behaviour? > -- 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 sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.