classification
Title: Command line option -t (and -tt) does not work for a particular case
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, jerome.radix, jerub
Priority: normal Keywords:

Created on 2011-02-25 14:00 by jerome.radix, last changed 2012-07-07 15:43 by gvanrossum. This issue is now closed.

Files
File name Uploaded Description Edit
test_tt.py jerome.radix, 2011-02-25 14:00 This example mixes tabs and spaces but -t option does not report any warning
Messages (3)
msg129368 - (view) Author: Jérôme Radix (jerome.radix) Date: 2011-02-25 14:00
The attached example mixes tabs and spaces but python does not report any warning when used with -t.

Line 4 contains 1 tab. Lines after line 4 contains spaces.

Tested using :
Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32

C:\>python -t test_tt.py

C:\>
msg164876 - (view) Author: Stephen Thorne (jerub) * Date: 2012-07-07 15:36
In discussion with GvR, we've decided we're not interested in intentionally rejecting code that is valid for tab width values between 1 and 8 inclusive.

Thanks for the bug report!
msg164882 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2012-07-07 15:43
The -t feature is not technically about rejecting all code that mixes tabs and spaces.  It is only about detecting code that mixes tabs and spaces IN SUCH A WAY THAT THE TAB SIZE AFFECTS THE VALIDITY OR MEANING OF THE CODE.

The sample program is only invalid if the tab size is >= 12 (or zero).

I don't think we should care about people who set their tab size > 8 -- realistically what people do is set it to values <= 8 (but >= 1), and their mistakes will be adequately caught.
History
Date User Action Args
2012-07-07 15:43:12gvanrossumsetstatus: open -> closed

nosy: + gvanrossum
messages: + msg164882

resolution: wont fix
2012-07-07 15:36:29jerubsetnosy: + jerub
messages: + msg164876
2011-02-25 14:00:58jerome.radixcreate