DOS, UNIX and tabs
Tom Plunket
tomas at fancy.org
Sun Dec 31 19:42:34 EST 2006
Marc 'BlackJack' Rintsch wrote:
> >> Did you try to open your code files with another editor, which has a
> >> different length for tabulator chars? It would look quite ugly, I
> >> guess...
> >
> > Actually, no. Everyone can choose their own number of spaces-per-tab and
> > it'll look right, as long as everyone uses a monospace font.
>
> You never tried that with tabs plus additional spaces to line up e.g.
> arguments that are broken across lines, right?
You must not understand what they're talking about, because it works
fine.
The example is this:
"""\
class Foo:
\tdef Function():
\t\tAnotherFunctionThatTakesManyArguments(arg1,
\t\t arg2,
\t\t arg3)
"""
> And there are a number of environments where you can't change the length
> of a tab like email or terminals where code will be displayed from time to
> time for example as diffs from a version control system.
That's the point of doing it in this way with tabs to specify indent
level and spaces to specify tabular alignment.
Me, I could never get emacs's python stuff to work suitably so I just
use a Dead Simple Editor (SciTE) in which I use tabs exclusively;
continuation indents are always exactly one additional tab over the
thing that's being continued.
Perhaps interestingly, for development I have my editor set to show tabs
as fairly short, but my diff program shows them as eight characters. I
find that makes indentation changes easier to spot in the diffs.
-tom!
--
More information about the Python-list
mailing list