Philippe C. Martin wrote:

> Any clue would be quite welcome.

I didn't recognize the pattern in the code you posted, but sometimes the
order of imports matters:

$ find .
.
./package
./package/beta.py
./package/alpha.py
./package/__init__.py
$ python
Python 2.3.3 (#1, Feb  5 2005, 16:22:10)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from package.beta import *
>>> from package import *
>>> from package.alpha import *
>>> alpha
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'alpha' is not defined
>>> beta
<module 'package.beta' from 'package/beta.py'>

The 'right' way to do the imports if you want both 'alpha' and 'beta' is of
course

from package import alpha
from package import beta

Peter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to