patching of python: tabs make me seek of python

Terry Reedy tjreedy at
Tue Jan 28 21:51:25 CET 2003

"Andrei Smirnov" <asmirnov at> wrote in message
news:f210c9f3.0301281143.22c01152 at
> hi
> i'm in python project. python is very good despite some problems
with threads
> but still very usefull (especially with swig).
> i'm using python with pleasure until i have to deal with tabs.

Use spaces 8-).  (But please, not another flame war, anyone.)

> it is about 4 people here who's doing development. nobody cares
about design
> yet, we don't know what we are doing :) it's okay, we are in good
shape for now.
> however i found that it is extremly difficult to work with somebody
else code
> and repackage my own code into classes. tabs always find the way out
of control.

Which is why many Pythoneers recommend to only use spaces for
indents -- and a Python aware editor.

> moreover, my favorite emacs keys to locate block boundaries doesn't
work, too bad.

Many Pythoneers use emacs.  I believe there is somewhere a special
setup file to make it properly Python-aware.  Are you using that?

> all that make me think that somebody already has THE PATCH to treat
curly braces
> as old c++ programmer would expect. it could be just a cmd line
switch to python.

You can already use '#{' and '#}' without a patch 8-).

> if nobody has it someday i might try to do that. any legal
objections from python
> maintainers regarding of distribution of that?

You are free to fork Python and make your own version.  It has been
done once (off of CPython, not counting translation to other
languages) that I know of.  But should you do so, please don't post
'curly-Python' code here.

> please, don't try to convince me that tabs are good:

Would not dream of it.  Some think that allowing both tabs and spaces
as indents was a mistake.

>i'm too lazy to even think about it. i just want curly braces.

Do you or don't you block indent your C++ code? If so, the braces are
To us here, laziness is omitting what is redundant and not needed.
Besides which, we avoid flame wars over where to put the braces.

Warning: if you keep using Python another month or two, you might
instead start thinking about patching C/C++ to recognize block indents
in addition to braces.  It has happened to other people.

Terry J. Reedy

More information about the Python-list mailing list