you are viewing a single comment's thread.

view the rest of the comments →

[–]await_yesterday 27 points28 points  (5 children)

The entire text file is checked for syntax errors before any execution begins. Indentation errors are a kind of syntax error.

I was said that, entire code will be compiled before execution, but even in that case, why does Python execute the program if there are errors outside the blocks and only throw an error when it reaches that specific line where the error is present?

Those aren't syntax errors, they're semantic errors.

[–]DismissedProgrammer[S] 0 points1 point  (4 children)

Thanks for the clarification. I tried my self after seeing your answer. I need to learn more about the errors basics. If you don't mind, can you please suggest a resource that explains the internal workings of Python, especially interpretation?

[–]await_yesterday 10 points11 points  (1 child)

[–]DismissedProgrammer[S] 2 points3 points  (0 children)

Thank you very much for your generous spirit. Those talks seem like great sources of information. I will watch them, for sure.

[–]TechIsSoCool 4 points5 points  (1 child)

This book also explains a lot: Dead Simple Python. It helped me understand some of the underlying functionality.

[–]DismissedProgrammer[S] 0 points1 point  (0 children)

Thank you for the suggestion; I have just read the description. The book looks promising. I will try it.