Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Incorrect. Consider a file test.py:

  print "hello"
  x = 1 +
Note the syntax error. Running it, we see:

  $ python test.py
    File "test.py", line 2
      x = 1 +
            ^
  SyntaxError: invalid syntax
If syntax errors were runtime errors, we would see the effect of the print statement. This is not a top-level effect: the same is true even if a syntax error is under a function.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: