On Tue, Oct 11, 2016 at 7:02 PM, Pierre-Alain Dorange
<pdora...@pas-de-pub-merci.mac.com> wrote:
> Chris Angelico <ros...@gmail.com> wrote:
>> >> Yes and no. Syntax errors are detected when the script is compiled, so
>> >> you can't do something like this:
>> >
>> > You're right, except that Python is never compiled, it was just checked
>> > for syntax error before interpreting code.
>> https://docs.python.org/3/library/functions.html#compile
>> It's compiled.
> Using this function, the code is "compiled".
> I do not think this function is often used and most python project
> simply use the interpreter (which do a small translation into byte-code
> to be faster and check syntax error before running interpretation).

When you import, the same form of compilation is done. It always
happens. Python does not execute your raw source code - it'd be too


Reply via email to