Re: how to import a module for global use in a library package ?

2010-05-12 Thread Jean-Michel Pichavant
Terry Reedy wrote: On 5/11/2010 8:04 AM, Auré Gourrier wrote: I might make one submodule for imports and then do 'from rootlib.util import importmod as m' in the template. But I have no need now for such. Terry Jan Reedy We did that, and we so regret it. After 5 years of intensive dev on tha

Re: how to import a module for global use in a library package ?

2010-05-11 Thread Terry Reedy
On 5/11/2010 8:04 AM, Auré Gourrier wrote: Dear all, I am building a library package of the form: rootlib ---__init__ ---subpackage1 --__init__ --sub1module1 --sub1module2 --... ---subpackage2 -- __init__ --sub2module1 --sub2module2 --... My rootlib.__init__ fil

Re: how to import a module for global use in a library package ?

2010-05-11 Thread Jean-Michel Pichavant
Auré Gourrier wrote: [snip] My question is the following: I need to import an external package, say numpy, for use in various submodules. So far, I simply do an import numpy as _numpy where needed, say sub1module1 and sub2module2. This means that I import this package a number of times which d

how to import a module for global use in a library package ?

2010-05-11 Thread Auré Gourrier
Dear all, I am building a library package of the form: rootlib ---__init__ ---subpackage1 --__init__ --sub1module1 --sub1module2 --... ---subpackage2 -- __init__ --sub2module1 --sub2module2 --... My rootlib.__init__ file contains: __name__= ... __version_