I spent 45 minutes last Tuesday stuck on a missing curly brace in my first Python script
The error kept pointing at the line below it so I kept rewriting code that was actually fine. Finally a guy on Stack Overflow said to count my brackets and yep, one was missing way up top. Has anyone else lost a whole evening to something that dumb?
Ugh, the bracket thing is real but the "line below" part is kinda misleading. Python actually points AT the line where it noticed something was wrong, and that's usually the line after the real problem because that's when it finally gives up. So your error wasn't pointing below the missing brace, it was pointing at the spot where the code stopped making sense to the parser. Same result though, you end up rewriting perfectly good code for 45 minutes. I've done it with missing parens on a function call that spanned like four lines, drove me nuts.