[Idle-dev] Foolish consistency?

Guido van Rossum guido@digicool.com
Mon, 11 Jun 2001 20:33:18 -0400


> Just wondering...
> 
> How come in the IDLE "shell window" automatice indents
> are by way of tabs, and in the IDLE "editor window"
> they are by way of multiples of four spaces (no tabs).
> 
> Is there a reason why these two should not follow
> the same convention?

It's a per-window option.  I chose the default to be tabs in the Shell
window because of the prompt: if it was 4 spaces there, your code
would look like this:

    >>> if x < 10:
	print y

which appears not indented right to some beginners.  With a tab it
looks like this:

    >>> if x < 10:
            print y

which is unambiguous.

For other windows the default is 4 spaces, which is more practical.

--Guido van Rossum (home page: http://www.python.org/~guido/)