Re: [sage-devel] PolynomialRing import problem

2012-11-11 Thread Nicolas M. Thiery
On Fri, Nov 09, 2012 at 12:26:11PM -0800, Volker Braun wrote: >You can do this: >class MyElement(Element): >def is_regular(self): >from sage.my_parent import MyParent >P = MyParent() >That way you don't import MyParent when you import the element, only wh

Re: [sage-devel] PolynomialRing import problem

2012-11-09 Thread Volker Braun
You can do this: class MyElement(Element): def is_regular(self): from sage.my_parent import MyParent P = MyParent() That way you don't import MyParent when you import the element, only when you run the is_regular() method. Alternatively, the parent could have an is_regular(x

Re: [sage-devel] PolynomialRing import problem

2012-11-09 Thread Charles Bouillaguet
On Nov 9, 2012, at 7:57 PM, Volker Braun wrote: > If you use the > > class MyParent(Parent) > Element = MyElement > > syntax then you have to import MyElement. So you shouldn't import MyParent in > your element code or you will create a cyclic import (=bad). > > Are you sure that you need