[Python-ideas] Pipe indentation
Chris Angelico
rosuav at gmail.com
Tue Dec 10 08:10:58 CET 2013
On Tue, Dec 10, 2013 at 6:02 PM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> But what does that mean? How does SciTE distinguish between "SPC TAB"
> at the beginning of line and just "TAB"? Where does it place guidelines
> given
>
> def f(x):
> SPC if x:
> SPC SPC print("gotcha")
> SPC else:
> SPC TAB print("gotcha again")
Hmm, actually I have no idea, so I just checked. Seems I was slightly
wrong in my description; the guides seem to be at fixed column
positions (configurable, but not dynamic). The differentiation between
tab and space is only for its signalling highlight - if you mismatch
indentation in any way, the wrong one is highlighted with a very
visible marker. And that highlight correctly accepts your above
example, though it's a little finicky to type (putting a space, then a
tab, on an otherwise-blank line deletes the space, but one can be
explicitly inserted after the tab's already there). The upshot is that
you get instant feedback if you ever get tabs/spaces wrong, and you
get nice guides if you always indent consistently, and in between is
shooting yourself in the foot anyway.
ChrisA
More information about the Python-ideas
mailing list