Importing modules

qwweeeit at yahoo.it qwweeeit at yahoo.it
Fri May 13 10:04:20 EDT 2005


Hi Fredrik,
thank you very much for your articles (especially that on
import-confusion). At last I grasped, also if not thorougly, the import
mechanism. What cleared my doubts was your recursive import paragraph.
In the Guido's "Python Reference Manual" he says:
"Import statements are executed in two steps: (1) find a module , and
initialize it if necessary..."
...almost like it was not necessary to go through it executing it (and
initializing the classes if necessary).
I made a small script to be sure and (...of course) confirmed what you
said...
I have still some doubts on the namespaces and functions/variables
visibility, but for that there is the error mechanism...
Bye.




More information about the Python-list mailing list