import statement convention

MartinRinehart at gmail.com MartinRinehart at gmail.com
Tue Apr 8 10:21:22 EDT 2008


By convention, I've read, your module begins with its import
statements. Is this always sensible?

I put imports that are needed for testing in the test code at the end
of the module. If only a bit of the module has a visual interface, why
pollute the global namespace with 'from Tkinter import *'? Wouldn't
that be better done in a separate class or function?

Can we do a better job with a thoughtful rewrite of this convention?



More information about the Python-list mailing list