[Tutor] The Order of Imports and install order of modules and other matters (XP vs W7, ...)
Alan Gauld
alan.gauld at btinternet.com
Sat Feb 13 10:33:01 CET 2010
"Wayne Watson" <sierra_mtnview at sbcglobal.net> wrote
> There seems to be something of a general consensus in ordering import
> statements. Something like standard library imports first.
I've never seen anything written down but its true I tend to do that.
But its not been a conscious thing...
> tools like matlablib or tkinter (maybe), must one keep an order among
> the relevant imports?
The order can be significant, especially if the module code has
executable statements in it or there are dependencies between them.
But with well written modules it should not matter provided you use
the straightforward import m style.
It will matter if you use the from m import * method though,
because of likely name collisions.
> Related to this is the order in which modules are installed. Does it
> make a difference?
Again it shouldn't but if the installer for one relies on another
(eg a GUI library) then it will.
> Finally, I'm in the process of moving Python code from XP to Win7. I
Sorry, I know nothing of W7... :-)
Alan G
More information about the Tutor
mailing list