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 Mikko Rantalainen
Recipients Mikko Rantalainen
Date 2019-10-16.08:00:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571212810.12.0.63942359908.issue38496@roundup.psfhosted.org>
In-reply-to
Content
Contrary to PEP-8 (https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces) claiming "Python 3 disallows mixing the use of tabs and spaces for indentation", in reality Python 3 allows mixing tabs and spaces without warnings or errors. For example (with all spaces replaced with middle dot and all spaces replaced with a short arrow):

#!/usr/bin/python3
for·i·in·range(2):
··for·j·in·range(3):
➧··for·k·in·range(4):
·➧···print(i,j,k,sep=",")

Either the PEP-8 should be fixed or the parser/compiler should be fixed. 

The current behavior seems a bit unstable because the exact order of spaces and tabs causes "TabError: inconsistent use of tabs and spaces in indentation" to appear more or less random.

I'd prefer python3 to require that *all whitespace* at the start of the all the lines is tabs for the whole file or spaces for the whole file. And first indented line sets the preference for the whole file.

(Personally I'd prefer tabs contrary to PEP-8 language but this bug is not about the preference. This is PEP-8 claiming things that are not true.)

$ python3 --version
Python 3.5.2
History
Date User Action Args
2019-10-16 08:00:10Mikko Rantalainensetrecipients: + Mikko Rantalainen
2019-10-16 08:00:10Mikko Rantalainensetmessageid: <1571212810.12.0.63942359908.issue38496@roundup.psfhosted.org>
2019-10-16 08:00:10Mikko Rantalainenlinkissue38496 messages
2019-10-16 08:00:09Mikko Rantalainencreate