[Tutor] Confused "from module import Name" better than "import module"?
marichar at csusb.edu
Mon Jul 11 19:56:43 CEST 2005
Kent Johnson wrote:
> This is good stuff to understand, but really, it isn't going to make an appreciable difference in most applications. Where it does matter, for example if func() is called many times in a loop, the best solution will probably be to bind func to a local variable which is the fastest to access.
> Pick the style that you find most practical and readable and don't worry about efficiency.
Thanks for the explanation. It won't make a difference in this really
short program I'm putting together, but I was curious about it. Going
through the library reference I found a bunch of modules that would
replace some ugly (but working) code I had, then started to wonder if
importing a bunch of different modules would have much of an effect. In
any case, I'm more concerned with readability.
College Of Arts & Letters
CSU San Bernardino
More information about the Tutor