PEP8 and 4 spaces

Marko Rauhamaa marko at
Tue Jul 8 13:13:09 CEST 2014

Chris Angelico <rosuav at>:

> Not quite; tools like diff that put a character at the beginning of
> the line are likely to be tab-aware,

No, just tried it again: diff outputs tabs as tabs.

   $ diff abc def
   <       abc
   <         abc
   >       def
   >         def

where line 1 begins with a tab and line 2 begins with 8 spaces in each

> and gcc is certainly going to comprehend them

   $ gcc -c test.c
   test.c:1:2: error: expected identifier or ‘(’ at end of input

where test.c contains


IOW, gcc reports that the open parenthesis is in column 2.

> (at least to the extent of treating them as whitespace).

Sure, but that doesn't concern the tab stops in any way.

> And I think less takes notice of them, too,


> so it's only the very simplest tools like cat that actually ignore
> them or treat them as single characters (or even bytes).

They all seem to be "simple." At least Python is:

   $ python3 -c 'print	('
     File "<string>", line 1
       print	(
   SyntaxError: unexpected EOF while parsing

where the caret is pointing at the wrong visual column.


More information about the Python-list mailing list