Making tabs illegal

Thomas Wouters thomas at xs4all.net
Fri Jul 7 18:55:28 EDT 2000


On Fri, Jul 07, 2000 at 10:23:18PM +0000, Forrest Cahoon wrote:
> In article <3950C0E2.7532D38 at sightreader.com>,
>   Ken Seehof <kens at sightreader.com> wrote:
> > [ ... ]
> >
> > As for the space/tab mixing issue, the answer is simple: Make tab an
> > illegal character in python.  Problem solved.

> Has anyone tried to patch the python sources to do this?  I'm too
> uncomfortable with the tab/space ambiguity to do serious work in python
> (in a team environment with programmers of varying skill levels) but
> this would *totally* solve it for me.

Guido's time machine strikes again ! I'm not sure how far back he went this
time, but certainly well before I did anything with Python ;) There's the
-t flag which does exactly what you want: '-t' warns when tabs and spaces
are mixed in a dangerous way. '-tt' emits a compile-time exception.

> I started to look at the python sources to do this myself, but I'm sure,
> since I'm totally unfamiliar with the internals at this point, my
> solution would probably be an ugly hack.

Well, asside from the fact that the requested feature is there already, I
can tell you that the Python internals are a very pleasant thing to hack !
It probably sounds less impressive from a nameless figure like me than from
some bigshot like Eric Raymond ;) but I was very impressed by the quality of
the code. And editing good code makes it very hard to write something
hackish, both because it's easy to find out how it should really be done,
and because it's a bit unfriendly... :-)

Laat-niet-als-dank-voor-het-aangenaam-verpozen---
  --de-maintainer-van-deze-source-de-schillen-en-de-dozen-<wink>ly y'rs,

(Before we get another Dutch <> English <> Swahili <> etc war, that means
'clean up after you' in an old dutch proverb ;)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list