V
1

Appreciation post: The moment I realized my Python indentation was breaking everything

I spent three entire days trying to debug a simple function, and my code kept throwing a 'SyntaxError' every single time. I was copying examples from a tutorial, but I was mixing tabs and spaces in my text editor without even knowing it. Python treats them differently, and my editor wasn't showing the difference. Has anyone else run into this invisible bug, and what editor setting finally fixed it for you?
3 comments

Log in to join the discussion

Log In
3 Comments
kai_burns73
Ever try writing Python on a shared terminal server?
2
cole_murphy
Shared terminal? My code looked like a toddler typed it after three cups of coffee. The lag made every typo a permanent mistake.
6
roberth66
roberth663d ago
Three cups of coffee? Man, I once had a 500 millisecond lag on a school server. I'd type "print" and watch the letters show up one by one after I'd already moved on. By the time the "t" appeared I'd have typed the whole next line, so everything was just a jumbled mess of wrong commands. It felt like coding through molasses, and the undo key was just a sad joke. That kind of lag doesn't just cause typos, it murders your whole train of thought.
5