Tabbing/Spaces

Steve Holden sholden at holdenweb.com
Sat Jan 20 11:56:28 EST 2001


"Martin Sandin" <msandin at remove_this.hotmail.com> wrote in message
news:94bjhl$as2$1 at news.gu.se...
> "Tim Peters" <tim.one at home.com> skrev i meddelandet
> news:mailman.979955644.18879.python-list at python.org...
>
> > *Mixing* tabs and spaces is insane in Python source.
>
> Insane it might be, but it is what is "recommended" in GvR's style guide:
>
> 'Tabs or Spaces?
> One indentation level is 4 spaces. Two levels is one tab. Three levels is
a
> tab and 4 spaces, and so on. Python doesn't mind if you indent one line
with
> 8 spaces and the next line with a tab -- they are considered to have the
> same indentation. Replacing all tabs with spaces is more robust in the
light
> of some editors on the Mac or PC (which default to displaying the tab
> character as 4 spaces instead of 8, as God intended) but this can be done
on
> transfer to such platforms.'
>
> Available from python.org, documentations GvR's essays :-)
>
> Me? A tab is 4 spaces, I hard tab indent my code. It's the easiest and
> fastest way for moving my code tab levels.
>
A tab is 4 spaces for me, too, but I make my editor actually use the spaces
instead of the tabs. Since it will remove spaces back to the last tab-stop
when I hit SHIFT-tab this means that my listings are correctly interpreted
by text-processing tools which insist on treating text as having tab stops
every eight spaces. There's nothing worse than a listing which runs off the
edge off the page (worst case) or wraps over (better) becaure the tabbing
indentation is too long.

regards
 Steve





More information about the Python-list mailing list