3 ms·
But the fact that python does this is a flaw. There would be no problems if it forced you to use the same spacing characters in a block instead of just the sam
by Dylan16807 15y ago
But the fact that python does this is a flaw. There would be no problems if it forced you to use the same spacing characters in a block instead of just the same spacing count.
For example.
if foo:
[tab]bar #valid
if foo:
bar #valid
if foo:
if baz:
bar #valid
if foo:
if baz:
[tab]bar #invalid Your four spaces disappeared but it wasn't a DEDENT.
if foo:
if baz:
[tab]bar #This can be valid, I guess. Doesn't harm anyone.
Once you don't allow people to interchange tabs and spaces it's perfectly safe to set tab width to any amount.
- sesqu 15y agoExactly. I strongly dislike the way indentation is assumed to be done with x spaces. I quite like my indents of size 1 tab, and would hope the lexer differentiates between <tab><3 space><tab> and <tab><tab><3 space>, since I certainly do.