Tabs -vs- Spaces: Tabs should have won.

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun Jul 17 05:07:43 CEST 2011


Andrew Berg wrote:

> I try to avoid aligning things unless not doing it really hurts
> readability for that reason. For example, in most of my source files, I
> use tabs to indent. Since Python won't allow a mix of tabs and spaces
> (for whitespace) on one line, I don't try to align things:
> 
> else:
> self.x264_cmd = [
> self.x264_exe, self.avs_file,
> '--fps', self.fpsr,
> '--sar', self.sar,
[snip rest of code]
> However, when alignment really matters, such as in a module's setup.py,
> spaces are the way to go:
> 
> from distutils.core import setup
> 
> setup(
>     name         = 'Elucidation',
>     version      = '0.0.1-WIP',
[snip]


Hilariously, in my newsreader, the first example (allegedly unaligned) was
lined up as straight as an arrow, while the allegedly aligned second
example was completely jagged and all over the place :)

The perils of proportional fonts.


-- 
Steven




More information about the Python-list mailing list