Emacs has eaten my python tabs!!!

John Roth johnroth at ameritech.net
Mon Jan 27 01:41:59 CET 2003

"Dennis Lee Bieber" <wlfraed at ix.netcom.com> wrote in message
news:pm7eg-im3.ln1 at beastie.ix.netcom.com...
> Mongryong fed this fish to the penguins on Sunday 26 January 2003
> am:
> > Doesn't python rely on tabs?
> >
>         It relies on indentation, and a tab is considered 8 spaces --

This isn't exactly correct. There's an undocumented hack in the
python compiler that recognizes the Emacs tab comment, among
others, and if it finds it, sets tabs to that value. I'm not certain of
which releases this is in, but it's been commented on a time or three.

This was, I believe, an attempt at one time to "fix" the mixed
tab and space problem.

> the only
> time mixed spaces and tabs works is when a tab stop is visually 8
> spaces. If one has an editor configured with 4-space tabs and then
> mixes lines with tabs and 4-spaces, Python sees two indentation
> 4 and 8 space.
>         All tabs works fine regardless of editor tab stops. All spaces
> fine. Mixed spaces and tabs is deadly.

So is the use of tabs in certain contexts; in particular any attempt
to e-mail a python source to someone using Outlook Express. OE
has this nasty habit of ignoring leading tabs.

John Roth
> --
>  > ============================================================== <
>  >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >      wulfraed at dm.net     |       Bestiaria Support Staff       <
>  > ============================================================== <
>  >        Bestiaria Home Page: http://www.beastie.dm.net/         <
>  >            Home Page: http://www.dm.net/~wulfraed/             <

More information about the Python-list mailing list