3 ms·
>The article claims tabs are more likely to be shredded than spaces, but I didn't find that to be true. def x():<enter> <tab>"Oh no I'm on the reply button!"<
by parfe 15y ago
>The article claims tabs are more likely to be shredded than spaces, but I didn't find that to be true.
def x():<enter>
<tab>"Oh no I'm on the reply button!"<Shift+Tab><space><space><space><space>print "Much Better"
- prodigal_erik 15y agoThe problem isn't entering a tab character (I'd be pasting code from a real editor anyway). The problem is that whatever indentation you use, whether it's tabs or spaces, is destroyed by many common tools, and un-indented Python is ambiguous and can't be fixed without guesswork.
- Goladus 15y agoTabs are more likely to be destroyed than spaces. Simply displaying a file in a character-based terminal shreds tabs. Spaces are fine. It's true there are tools, especially on the web, that eliminate whitespace and if you rely on those tools using python is going to be a problem. But generally it's pretty obvious whether that's going to be an issue. Tab problems tend to sneak up when you least expect it.