On Mon, May 21, 2012 at 01:24:38PM -0700, Anne Schilling wrote:
> On 5/21/12 12:52 AM, Nicolas M. Thiery wrote:
> > ------------------------------------------------------------------------------
> > To avoid  import loops, I try to stick to the following order:
> > 
> > - Python modules
> > - Misc
> > - Categories
> > - Stuff in sage.structure
> > - Basic parents (NN, QQ, ...)
> > - Rest of the stuff
> > 
> > and a module in one of the above items should only import modules from
> > higher items. E.g. a module in sage.categories can import from a
> > module in sage.misc, but not reciprocally.
> > ------------------------------------------------------------------------------
>
> Is this a rule for the import statements at the beginning of the file?

Yes. Well, that's the rule I follow myself, and would tend to
recommend. I guess it's time to open the debate about this on
sage-devel (though I won't be able to do it before I come back from
China).

> I am currently implementing an __iter__ method for the category of
> Crystals. But without any further import statements, I get an import
> loop just by adding this method.

This should not occur. Make sure that this really is the only change.

> How can I debug this?

Usually the traceback is quite informative on which module import
which. Then you have to figure out where it's most natural to break
the loop.

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-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to