Hi Simon, Am Freitag, 5. Juli 2013 12:26:19 UTC+2 schrieb Simon King: > > Hi Thomas, > > On 2013-07-04, Thomas Feulner <thomas....@uni-bayreuth.de <javascript:>> > wrote: > > I am trying to build a class which derives from Parent and > QuotientRing_nc > > at the same time.
I want to inherit from Y and QuotientRing_nc at the same time. So, how can I avoid this situation? > Actually, QuotientRing_nc not only inherits from Parent, but from > ParentWithGens. _assign_names is inherited from there. Your > initialisation only takes into account Parent.__init__, but not > QuotientRing_nc.__init__, I guess that's where the problem comes from. > > You are right, maybe my example was to tiny. Here is another one, which also initializes the QuotientRing_nc, too: sage: from sage.rings.quotient_ring import QuotientRing_nc sage: class Y(Parent): ....: def __init__(self, gens, names): ....: Parent.__init__(self, Integers(), gens=gens, names= names) sage: class X(Y, QuotientRing_nc): ....: def __init__(self, R, I): ....: Y.__init__(self, gens=[R.gen(0), R.gen(1)], names=['x' , 'y']) ....: QuotientRing_nc.__init__(R, I) sage: R = PolynomialRing(Integers(), 'a,b,c') sage: R.ideal(R.gen(0)) Ideal (a) of Multivariate Polynomial Ring in a, b, c over Integer Ring sage: x = X(R, I) But the problem is still there. Do you have any other suggestions? Best wishes, Thomas -- 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/groups/opt_out.