Re:Ask YC: Best practice for Python module imports?
by babyshake on Sunday June 14, 2009 @05:12PM
(#657555)
My own preference is on a case-by-case basis, and typically depends on whether I'm importing a module specific to my application, like a model or logic library, and whether I only need it for one specific method.
Standard libraries I'm more likely to import globally, since I'm more likely to want to use them several times.
The most important thing is to figure out what works for you, and then be consistent about it.
Standard libraries I'm more likely to import globally, since I'm more likely to want to use them several times.
The most important thing is to figure out what works for you, and then be consistent about it.