Does python always need to compile ENTIRE program before it c an start to run it???

Ellinghaus, Lance lance.ellinghaus at eds.com
Mon Nov 3 18:34:32 EST 2003


Peter,
That is correct. It is separate phases, but is it not true that after the
module is loaded, it is then executed?
This execution possibly can cause additional modules to be loaded. This is
not the case if the 'import' statement is located within 'def' or 'class' as
the code within the 'def' or 'class' is not executed until the
function/class is called.

Please correct me if I am wrong.


Lance Ellinghaus
EDS - TWAI Operations
Phone: 214-922-5454
Cell: 940-597-4755



-----Original Message-----
From: Peter Hansen [mailto:peter at engcorp.com] 
Sent: Monday, November 03, 2003 4:09 PM
To: python-list at python.org
Subject: Re: Does python always need to compile ENTIRE program before it can
start to run it???


seberino at spawar.navy.mil wrote:
> 
> Lance
> 
> Thanks for the info.  I agree that the initial script you
> run must be compiled completely before it can execute.
> Does "completely" =  all the imported modules too?

No, compilation is a separate step *prior* to execution, and "import" is a
statement that is *executed*, not something special that happens during
compilation.

-Peter
-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list