Python indentation (3 spaces)

Chris Angelico rosuav at gmail.com
Mon Oct 15 01:17:30 EDT 2018


On Mon, Oct 15, 2018 at 3:51 PM Marko Rauhamaa <marko at pacujo.net> wrote:
> The two-space indentation is the out-of-the-box default for emacs.
> However, the tab collapsing principle is a universal default. If you go
> against it, you will have to educate more tools than your editor. For
> example, try running this Python snippet (in REPL or as a program):
>
>     for i in range(32):
>         print("x{}\ty".format(" " * i))
>

I don't understand your point here. It prints a letter, then some
spaces, then a tab, then another letter. On my terminal, that displays
the tab by advancing to the next tab position. If I highlight to
select, it's obvious that the spaces have not been collapsed or
converted in any way; it is indeed printing that many spaces, then a
tab. Universal default? Not very.

ChrisA



More information about the Python-list mailing list