Re: handling modules in packages

2007-09-05 Thread Bruno Desthuilliers
Tommy Grav a écrit : (snip) > > So am I understanding it right that a second import numpy statement > in a different module (and thus a different namespace) just results in > a binding to the already existing numpy "object"? Yes. And FWIW, you can drop the quotes around the word 'object', becaus

Re: handling modules in packages

2007-09-05 Thread Daniel Larsson
On 9/5/07, Tommy Grav <[EMAIL PROTECTED]> wrote: > > >> > > The simplest thing to do would be to have PyAstro.__init__.py > > import all > > the sub-modules, and define __all__ as the set of names that the > > package > > should inject into importing modules. > > > > Then you could write (for examp

Re: handling modules in packages

2007-09-05 Thread Tommy Grav
>> > The simplest thing to do would be to have PyAstro.__init__.py > import all > the sub-modules, and define __all__ as the set of names that the > package > should inject into importing modules. > > Then you could write (for example) > > from PyAstro import numpy, constants, conversion, obsrv

Re: handling modules in packages

2007-09-05 Thread Diez B. Roggisch
Tommy Grav wrote: > Hi, > >I am working on a package that contains a number of > different modules: > > > ls pyAstro > __init__.py > constants.py > conversion.py > observation.py > orbit.py > transformation.py > > however, I find that several of the modules have the > same import statement

Re: handling modules in packages

2007-09-05 Thread Steve Holden
Tommy Grav wrote: > Hi, > >I am working on a package that contains a number of > different modules: > > > ls pyAstro > __init__.py > constants.py > conversion.py > observation.py > orbit.py > transformation.py > > however, I find that several of the modules have the > same import statements

handling modules in packages

2007-09-05 Thread Tommy Grav
Hi, I am working on a package that contains a number of different modules: > ls pyAstro __init__.py constants.py conversion.py observation.py orbit.py transformation.py however, I find that several of the modules have the same import statements: orbit.py: import numpy import constants impo