Why not enforce four space indentations in version 3.x?

Inky 788 inky788 at gmail.com
Thu Jul 16 13:47:07 EDT 2009


On Jul 16, 10:18 am, Tim Chase <python.l... at tim.thechases.com> wrote:
> > I realize that a small portion of the community likes the tabs.
> > They're sold on the tabs. They like the tabs. But tabs are an archaic
> > holdover from an era when typewriters had physical tabstops on them.
>
> However, they are a single logical level of indentation -- I come
> down fairly solidly on the "tabs" side of the "tabs vs. spaces"
> argument.

My bet is that the problem is this: some people like to format their
code in ways that don't work well when you're using tabs. For example,
they might want to call a function like this (note spaces):

some_func(foo=1,
          bar=2,
          baz=3)

instead of:

some_func(
    foo=1,
    bar=2,
    baz=3)

The first one requires 10 spaces in front of bar and baz. If you're
using tabs, that means one or two tabs plus some space characters. So,
people who do that would probably never use tabs. The 2nd example is
fine for tabs or spaces. I'm sure there are a bunch of similar
examples for things besides function calls. Don't you ever find cases
where you'd like to add in an extra space or two to make things line
up nicely?

> I can set my editor (vim in this case) to show tabs as
> as many spaces as I want.  I usually have this set to 4, but
> sometimes 1 or 2.

Just curious: why would you want to do that? In my experience, once my
eyes got used to 4-space indents, everything else looks either too
little or too much. :)



More information about the Python-list mailing list