3 ms·
A literal tab character is equivalent to 8 spaces in Python source (or 1-7 spaces if the tab is preceded by a number of spaces that is not an even multiple of 8
by polpo 9y ago
A literal tab character is equivalent to 8 spaces in Python source (or 1-7 spaces if the tab is preceded by a number of spaces that is not an even multiple of 8). This follows well-established Unix standards.
So the following lines are at equivalent indentation:
<SPC><SPC><SPC><SPC><SPC><SPC><SPC><SPC>foo
<TAB>foo
Or do you mean that when you press the tab key in your editor when editing Python, you don't like that it emits 4 spaces instead?