Just saw a friend's code and they keep putting semicolons in Python
They came from learning JavaScript first and kept adding them out of habit. It doesn't break Python, but it's not the standard style and can look messy to other people reading the code. I found a style guide from the Python Software Foundation that says to avoid them. How do you break a habit like that from a different language?
Forget the linter, just delete them as you type. Your brain adapts way faster when your hands feel the mistake. I tried the linter route and it just made me ignore warnings after a while. Actually backspacing over each one builds the muscle memory. Took me about a week of writing new code before the urge to type a semicolon just stopped.
Backspacing over every semicolon sounds like a special kind of coding torture (but maybe the painful kind that works). My linter warnings just become invisible wallpaper after two days, so I see the logic. A week of that and your fingers would probably revolt and start typing Python instead.
Forget the technical side for a second. The real trick is making it feel wrong instead of just unnecessary. Write a tiny Python script that scans your file and literally beeps at you every time you type a semicolon. That auditory feedback triggers a flinch reflex way faster than a visual warning. After a few days of your computer screeching at you like a angry smoke detector, your brain will associate semicolons with pure annoyance. It's like training a dog with a shock collar but way less unethical.