[SciPy-user] OpenOpt svn broken on Windows

Alan G Isaac aisaac@american....
Wed Jul 16 15:42:52 CDT 2008


On Wed, 16 Jul 2008, Matthieu Brucher apparently wrote:
> you modify the reference, but not the underlying variable. 

This may be helpful:
http://effbot.org/zone/import-confusion.htm#what-does-python-do

Importing a module creates a module object
and then executes the module's code in this object's namespace.
Like other objects, this object allows dynamic attribute 
assignment. (E.g., you could say ``module1.t='test'``
even though module1 does not define ``t``.)

But for each module you can only import once.
(Ignoring ``reload``.)  Subsequent imports statements
will therefore not recover the assignments made in the module.

One thing that follows is that
``from module1 import s``
is alot like
import module1
``s = module1.s``
(except the latter has ``module1`` in the namespace).

fwiw,
Alan





More information about the SciPy-user mailing list