This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients BreamoreBoy, abacabadabacaba, martin.panter, r.david.murray, skrah
Date 2015-05-24.23:27:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432510069.79.0.103932821529.issue24260@psf.upfronthosting.co.za>
In-reply-to
Content
I would be in favour of making the existing indentation behaviour more strict by default, or at least outputting some sort of warning for Evgeny’s examples. I.e. no reason to supply a special -ttt option.

But prohibiting tabs entirely might not go down well. I never use tabs in my own code, but I wouldn’t want to convert other people’s code to spaces just to run it in a future Python release, especially when the tab usage is universal.

I don’t exactly know Python’s rules for intentation, but my model for “consistent indentation” would work something like:

* Remember the exact sequence of spaces and tabs for each level of indentation
* Ignore blank and commented lines, even if their indentation is inconsistent
* If a line begins with the highest level of indentation, but continues with more spaces or tabs, it starts a new indentation level
* If a line’s indentation exactly matches any of the saved sequences, it jumps back to that level (or stays at the highest level)
* Otherwise, the indentation is inconsistent, and it should be an error or warning

Yet another option could be to say indentation is allowed to be only tabs or only spaces, and the use of tabs or spaces must match the rest of the file, or at least the rest of the indented block. But I still prefer my model above :)
History
Date User Action Args
2015-05-24 23:27:49martin.pantersetrecipients: + martin.panter, r.david.murray, skrah, abacabadabacaba, BreamoreBoy
2015-05-24 23:27:49martin.pantersetmessageid: <1432510069.79.0.103932821529.issue24260@psf.upfronthosting.co.za>
2015-05-24 23:27:49martin.panterlinkissue24260 messages
2015-05-24 23:27:49martin.pantercreate