Python Forum
When does Python detect Errors?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When does Python detect Errors?
#1
Hello, I am currently confused about the different times when errors are detected in Python...

First, for my understanding:
Python initially translates the written code into bytecode, and this time is called "compilation." Then, the code is interpreted line by line, which is the runtime. We cannot speak of a strict compilation like in Java in the case of Python. Have I understood everything correctly up to this point?

Now, for my next issue:
I don't quite understand when different errors are detected in Python.
For example, shouldn't a Syntax Error be detected during compilation? Because Python cannot translate grammatically incorrect code. However, my script states that Python recognizes Syntax Errors when the interpreter reaches the faulty line (and executes the code up to that point). Which one is correct?

As for static-semantic and dynamic-semantic errors, in my understanding, they should be detected during runtime. For instance, accessing an undefined variable does not involve a grammatical error, so the code can be translated without issues.

Thank you for any assistance!
Reply


Messages In This Thread
When does Python detect Errors? - by stamp1t - Oct-21-2023, 04:56 PM
RE: When does Python detect Errors? - by deanhystad - Oct-21-2023, 05:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to detect abnormal data in big database python vanphuht91 5 1,183 Jun-27-2023, 11:22 PM
Last Post: Skaperen
  Rmarkdown opened by python code - errors Rav013 0 2,124 Apr-27-2021, 03:13 PM
Last Post: Rav013
  Python Request Errors PythonNoob1998 7 4,100 Jan-07-2021, 05:18 PM
Last Post: buran
  Python chess game to detect winner ddddd 1 2,027 Dec-13-2020, 10:24 PM
Last Post: michael1789
  How to detect the text above lines using OpenCV in Python pframe 0 2,537 Apr-14-2020, 09:53 AM
Last Post: pframe
  Pip Syntax Errors in CMD: Windows 10 and Python 3.8.1 jamesphopper 2 4,498 Feb-08-2020, 07:21 PM
Last Post: jamesphopper
  Python stops without errors shahgourav 4 2,818 Feb-04-2020, 11:44 PM
Last Post: micseydel
  Can the comments produce errors in python? newbieAuggie2019 9 4,384 Nov-26-2019, 12:19 AM
Last Post: micseydel
  Detect finger clicks/snaps using Python fwinter102 0 2,065 Aug-12-2019, 04:02 PM
Last Post: fwinter102
  Running into errors when installing pip and pip3 on python 2.7 and python 3.6 tej7gandhi 1 2,881 May-05-2019, 10:37 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020