Tabs for indentation & Spaces for alignment in Python 3?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Dec 5 17:29:17 EST 2014


Cameron Simpson wrote:

> I have spent too much time reading files indented
> with TABs by people using a different tabwidth to my own, and thus looking
> aweful on my screen. The original author didn't choose to make it awful,
> but their tabs rendered in my tab scheme look awful. And doubtless vice
> versa. The root cause of this is that when we, as humans, indent with
> tabs, we do it to achieve a certain visual effect; as though a certain
> number of spaces were in play.

How is this different from people who achieve a certain visual effect by
indenting with actual spaces?

I've seen people indent with 8 spaces. I've seen people indent with 2
spaces. I've even seen people indent with a single space per level. I
haven't seen anyone indent with 17 spaces, but I suppose it's only a matter
of time...

I don't see how reading code indented with tabs configured for 8/4/2/1
spaces is *worse* than reading tab indented with 8/4/2/1 spaces.




-- 
Steven




More information about the Python-list mailing list