[SciPy-dev] scipy structure

Pearu Peterson pearu at cens.ioc.ee
Thu Feb 28 12:26:22 CST 2002


Hi Travis,

On Tue, 26 Feb 2002, Travis Oliphant wrote:

> The problem is that we want the user to have access to a series of
> submodules under the scipy namespace, e.g.

<snip> 

> all work as expected.

That's fine.


> The problem is due to faulty file systems on Windows and MAC OS platforms
> ( :-) ) that mangle the case of file names.  This requires that for
> packages modules must be explicitly loaded and the __all__ variable set in
> the __init__.py file (this is my understanding anyway).
> 
> Otherwise
> 
> from package import *
> 
> won't load all the names accessible as
> 
> package.XXXX

If I read Section 6.4.1 in

  http://www.python.org/doc/current/tut/node8.html

then I figure that the issue with Windows FS can be solved using
__all__ lists only: if package defines __all__ = ['xxxx']
then

  from package import *

will load the name xxxx, even if it is the name of a module XxXx.py. The
problems may occure only if __all__ is not defined, but it is always good
to have __all__. For example, for the help system. Also for reducing
unnecessary names when doing from .. import *.

Travis, can you confirm my understanding of Section 6.4.1? 
Is it possible to rework the structure of scipy by following Python
recommendations that also includes Section 6.4.2? 

I think it will make scipy code more readable and cleanup many
dependecies. It might mean extra work now (that I am also willing to
do) but later the code base of scipy may become much larger and any
restructuring will be more difficult to do.
What do you think?

Note that PEPs 235,250 might be also relevant for Windows platforms,
though they are implemented for Python 2.2.

Pearu




More information about the Scipy-dev mailing list