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 when
>    you run the is_regular() method.
>    Alternatively, the parent could have an is_regular(x) method and in the
>    element you just call self.parent().is_regular(self).

``lazy_import`` might be an option too.

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to