3 ms·
Newlines are invisible characters. Tabs+spaces are the real problem with python indentation. It should be a compiler error to mix them in a file.
by gohrt 13y ago
Newlines are invisible characters.
Tabs+spaces are the real problem with python indentation. It should be a compiler error to mix them in a file.
- shurcooL 13y agoI would not classify newlines as invisible characters. Except maybe the last newline in the file. Invisible characters are those that you can't tell if they're present or not. Assuming there are visible characters following, a newline can be clearly "seen" because it shifts the remaining text one line lower.
- Someone 13y agoYou must have never encountered a file with mixed line endings. Somebody should design an esoteric language that uses LF to separate statements in a block and CRLF to separate blocks. Alternatively, find a unicode line break character that editors recognize, but C doesn't treat as a line break, and sneak it into a source file at a strategic place to introduce a back door.
- gmjosack 13y agoSemi-related, you might be interested in Whitespace http://en.wikipedia.org/wiki/Whitespace_(programming_language) http://en.wikipedia.org/wiki/Whitespace_(programming_languag...
- sanxiyn 13y agoWhile this is now impossible to fix because of backward compatibility, you can use alias python='python -tt' in your environment. Given that option, it is a compiler error(TabError) to mix tabs and spaces.
- keypusher 13y agoThis is a great tip, thanks!