Import confusion
Kristian Ovaska
kristian.ovaska at helsinki.fi
Sat Apr 7 14:18:54 EDT 2001
"Fredrik Lundh" <fredrik at pythonware.com>:
>no, it's a reference to the *object* pointed to by m2.x, at the time
>from-import was executed. your setX function changes what m2.x
>refers to, not the object. m1 won't notice.
Now I understand. Thanks!
>if it's still not clear, remember the fourth from-import rule: don't
>use from-import unless you know exactly what you're doing ;-)
I normally don't use from-import, but I have special needs for one
project I'm working on. I process HTML files that contain embedded
Python code, and I define handy variables and functions that can be
used by embedded scripts. I make the definitions in a separate module
to keep code structure clear.
--
Kristian Ovaska <kristian.ovaska at helsinki.fi>
More information about the Python-list
mailing list