On 10/10/2016 16:44, Pierre-Alain Dorange 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.

In the case of CPython, source code is compiled into byte-code before it's interpreted. Part of that process is detecting syntax errors.

AFAIK, this is usually done a module at a time (convert an entire module to byte-code, then start interpreting). It might be a little different with functions such as eval and exec.

--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to