Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82011

Tabs for indentation & Spaces for alignment in Python 3?

Date 2014-12-05 17:40 +0000
Subject Tabs for indentation & Spaces for alignment in Python 3?
From Aahan Krish <krish@aahan.me>
Newsgroups comp.lang.python
Message-ID <mailman.16632.1417801617.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

I have two general questions regarding Python that I couldn't find any good
answers for. This is not the often-asked Tabs vs Spaces question, so kindly
read it in whole.

*Q1.* This is not to debate the decision, but I really wanted to know the
reason why PEP 8 chose to go with spaces instead of tabs. I read that tabs
were initially preferred over spaces (esp. Mr. Rossum)? What caused the
decision that spaces are better?

According to Core Python Programming (Book):

...because tabs vary in the number of spaces depending on your system, we
> recommend not using tabs if there is any hint of cross-platform development.
>

Isn't that a feature of tabs? (i.e. allowing the user to configure the size
of a tab stop in his editor, which has no affect whatsoever on the tab
character itself or how it displays in another user's editor.)

Is it the difficulty to adhere to the Maximum Line Length (79) when using
tabs? or is it simply because most of the Python programmers were using
spaces (or were adamant on using them) at the time of the decision-making
process?

*Q2.* PEP 8 also reads, "Python 3 disallows mixing the use of tabs and
spaces for indentation."

So, if I am using tabs for indentation and spaces for alignment, is it
still considered "mixing the use of tabs and spaces" in Python 3? (Please
see this example
<http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/#css>.)

Thank you very much for your time!


Best
Aahan

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Tabs for indentation & Spaces for alignment in Python 3? Aahan Krish <krish@aahan.me> - 2014-12-05 17:40 +0000
  Re: Tabs for indentation & Spaces for alignment in Python 3? sohcahtoa82@gmail.com - 2014-12-05 10:50 -0800

csiph-web