[Tutor] (getch() equivalent) [fun with imports]
Erik Price
erikprice@mac.com
Sun Mar 9 08:43:02 2003
On Sunday, March 9, 2003, at 02:11 AM, Danny Yoo wrote:
> Just as local variables are visible only with the enclosing function,
> local module imports are treated with the same rule. Doing 'import'
> within a function very unusual: it's not often useful to localize a
> module
> to a single function, since it's probably going to be used everywhere
> in a
> program.
Is there a significant performance hit when importing a module twice in
this fashion? Or does the Python processor keep all of the imported
objects cached in memory so that if it is imported a second time, even
in a separate namespace, a module will not be searched for and loaded
again?
Erik
--
Erik Price
email: erikprice@mac.com
jabber: erikprice@jabber.org