[SciPy-dev] scipy structure
pearu at cens.ioc.ee
Thu Feb 28 12:26:22 CST 2002
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.
> all work as expected.
> 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).
> from package import *
> won't load all the names accessible as
If I read Section 6.4.1 in
then I figure that the issue with Windows FS can be solved using
__all__ lists only: if package defines __all__ = ['xxxx']
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.
More information about the Scipy-dev