PEP8 and 4 spaces

Gregory Ewing greg.ewing at canterbury.ac.nz
Fri Jul 4 02:55:37 EDT 2014


Steven D'Aprano wrote:

>>That's exactly the problem with tabs - whatever you think your code
>>looks like with tabs, other people will see quite different picture.
> 
> Why do you consider this a problem?

It's a problem if you try to use tabs for lining things
up in a tabular fashion in your source code.

The solution is not to use tabs for that -- only use
tabs for indentation, and use spaces for everything
else. Or, as PEP 8 suggests, don't try to line things
up in the first place.

I know it's ironic that tabs are no good for tabulation.
But it's unavoidable in a plain text format that doesn't
carry any metadata about how to interpret the tabs.

-- 
Greg



More information about the Python-list mailing list