> the construct
>
>      from oddmodule import OddVariable, OddFunction
>
> assigns the *values* of the given module names to new variables in the
> importing module's namespace.  that is, you're binding new names to the
> values the variables happen to have when the from-import statement is
> executed.

Ah right, this does indeed explain what I'm seeing. For some reason I
thought "from module import variable" magically makes "variable" an
"alias", so to speak, for "module.var", which of course it does not.

> Yes. Think of
>
> from module import var
>
> as a shortcut for
>
> import module
> var = module.var
> del module

Good tip, I'll remember this. Thanks very much Fredrik, Peter!

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

Reply via email to