Eric Firing wrote:
> John Hunter wrote:
>> On 7/13/07, Ted Drain <[EMAIL PROTECTED]> wrote:
>>> I think he means that the matplotlib/__init__.py file should be
>>> changed to that those things are imported.
>> but if __init__.py imports axes, and axes import matplotlib, don't we
>> still have the problem of recursive imports?
> 
> Yes, but that is not necessarily fatal. It depends on the order in which 
> things are defined and imports are made:
> 
> http://effbot.org/zone/import-confusion.htm
> 
> Is there a significant performance penalty, however, in forcing every 
> module to be imported every time any mpl script is run, regardless of 
> whether the module is used in that script?
> 
> Anyway, I *think* it is feasible to arrange matplotlib.__init__.py so 
> that it imports all the modules, and then use
> 
> import matplotlib as mpl
> ... mpl.cbook.is_iterable(x) ...
> 
> both in scripts and within mpl modules.

I have done a little experimentation, and I am pretty sure this will 
work.  The problem I have run into so far is that in the initial orgy of 
importing, at the end of matplotlib/__init__, one has to be careful 
about the order so that kwdocd entries exist when they are needed.

So, John, is this the direction you would like to go?  It would mean 
that a long list of module imports at the top of each module would go 
away, replaced by the single "import matplotlib as mpl".  This is 
simpler, but it removes the concise information about what modules a 
given module depends on.

Eric
> 
> Whether this is the best approach is another question.
> 
> Eric
>> JDH

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to