Spaces and tabs again

Jeff Schwab jeffrey.schwab at rcn.com
Sat Aug 13 11:28:36 EDT 2005


bearophileHUGS at lycos.com wrote:
> Hello, I know this topic was discussed a *lot* in the past, sorry if it
> bores you...
> 
>>From the Daily Python-URL I've seen this interesting Floating Point
> Benchmark:
> http://www.fourmilab.ch/fourmilog/archives/2005-08/000567.html
> 
> This is the source pack:
> http://www.fourmilab.ch/fbench/fbench.zip
> 
> I've read its Python sourcecode, probably there few things that can be
> changed to speed it up some (like moving the main code in a function,
> using Psyco, or even vectorizing it with numarray), but I've had
> problems in changing the code because it mixes tabs and spaces for the
> indentations.
> I like a lot how Python uses indentations, I've never had problems with
> them in my programs, but I have big problems when I find a source that
> mixes them (I often need time to find how much spaces a tab is, to try
> to convert them all in spaces).
> I know that some people likes tabs, and other people likes spaces, so
> probably a single standard cannot be enforced, but I think the python
> compiler must generate an error (and stop compiling) when the
> sourcecode of a module contains both spaces and tabs to indent the
> lines of code (and comments lines too?).


What's wrong with mixing spaces and tabs?  Either way, it's pretty easy 
to convert back & forth.  In Vim:

	:set expandtab
	:%retab



More information about the Python-list mailing list