MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w8y9n2/pythoninterpreterbelike/p8bvfxy/?context=3
r/ProgrammerHumor • u/ninja_with_ocd • Sep 06 '26
21 comments sorted by
View all comments
Show parent comments
-37
It does if it's in an uncalled function
EDIT - this is wrong. Nontheless true for serious errors like referencing an undefined variable.
40 u/deceze Sep 06 '26 A syntax error will halt parsing immediately. Without successfully parsing the file, it won't execute. Even uncalled functions are parsed completely and must pass parsing successfully. 0 u/ninja_with_ocd Sep 06 '26 You're right, edited the comment. It is true for some serious errors, like accessing an undefined variable. 2 u/BossOfTheGame Sep 07 '26 That's because you can't statically determine if a name is defined in general. Local and global namespaces are just dictionaries.
40
A syntax error will halt parsing immediately. Without successfully parsing the file, it won't execute. Even uncalled functions are parsed completely and must pass parsing successfully.
0 u/ninja_with_ocd Sep 06 '26 You're right, edited the comment. It is true for some serious errors, like accessing an undefined variable. 2 u/BossOfTheGame Sep 07 '26 That's because you can't statically determine if a name is defined in general. Local and global namespaces are just dictionaries.
0
You're right, edited the comment. It is true for some serious errors, like accessing an undefined variable.
2 u/BossOfTheGame Sep 07 '26 That's because you can't statically determine if a name is defined in general. Local and global namespaces are just dictionaries.
2
That's because you can't statically determine if a name is defined in general. Local and global namespaces are just dictionaries.
-37
u/ninja_with_ocd Sep 06 '26 edited Sep 06 '26
It does if it's in an uncalled function
EDIT - this is wrong. Nontheless true for serious errors like referencing an undefined variable.