Tabs for indentation & Spaces for alignment in Python 3?

Ned Batchelder ned at nedbatchelder.com
Fri Dec 5 16:34:07 EST 2014


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




More information about the Python-list mailing list