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


Groups > comp.lang.python > #82023

Re: Tabs for indentation & Spaces for alignment in Python 3?

From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: Tabs for indentation & Spaces for alignment in Python 3?
Date 2014-12-05 16:34 -0500
References <CAFaCOgxQvq0TmS7G3f_bZ8HV+eUGSh5DSZiGxi7KhL_Yfp6Zdg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16641.1417815258.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 12/5/14 1:49 PM, Aahan Krish wrote:
> Hello Ian,
>
> So, wrt Q2, what you are saying is, the following would cause issues in
> Python 3?
>
>      int f(int x,
>      ......int y) {
>      --->return g(x,
>      --->.........y);
>      }
>
> Where:
>
> ---> for tabs (used for indentation)
> .... for spaces (used for alignment)

(Aside from the fact that that isn't Python syntax *at all*), Python 3 
would be OK with that indentation. It wouldn't be OK with mixed tabs and 
spaces where the meaning depends on the indent width of a tab, but here 
it does not.

I sincerely hope no one is seriously considering trying to maintain code 
using a mix of tabs and spaces like that.  That's a nightmare.

-- 
Ned Batchelder, http://nedbatchelder.com

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


Thread

Re: Tabs for indentation & Spaces for alignment in Python 3? Ned Batchelder <ned@nedbatchelder.com> - 2014-12-05 16:34 -0500

csiph-web