[issue24260] TabError behavior doesn't match documentation

2021-03-13 Thread Facundo Batista
Facundo Batista added the comment: Found this after seeing (once again) somebody asking for help in Python Argentina after having a file mixing tabs and spaces. This tends to catch new people. I'm +1 to just raise an error if the file mixes tabs and spaces for indentation. I've never seen

[issue24260] TabError behavior doesn't match documentation

2019-10-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24260] TabError behavior doesn't match documentation

2019-10-17 Thread Mikko Rantalainen
Mikko Rantalainen added the comment: As I wrote in duplicate issue38496 (with emphasis added): 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

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker ___ ___ Python-bugs-list

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread Stefan Krah
Stefan Krah added the comment: python-dev is becoming insufferable. -- ___ Python tracker ___

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Lets not continue a holy war here. I'm in the camp of tab-indenters. -- ___ Python tracker

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread Stefan Krah
Stefan Krah added the comment: I'm now in the camp of forbidding tabs. When I wrote my own parser a couple of years ago, I tested it on a huge body of Python files that were present on my system. Tabs always looked accidental. Is there any *known* code base that

[issue24260] TabError behavior doesn't match documentation

2017-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My model is the same as the Martin's one. I know how to implement this, but the code isn't simple. I'm going to do this after fixing other bugs in the tokenizer. -- nosy: +serhiy.storchaka priority: normal -> low

[issue24260] TabError behavior doesn't match documentation

2015-05-26 Thread Stefan Krah
Stefan Krah added the comment: Prohibiting tabs after spaces is not enough. No, I really meant that once a new block is started with tabs, all following nested blocks must use tabs for indentation. The only place where spaces would be allowed is for aligment in logical lines that extend over

[issue24260] TabError behavior doesn't match documentation

2015-05-24 Thread R. David Murray
R. David Murray added the comment: We should probably just introduce a new error mode (-ttt?) that makes it an error to use tabs at all for semantic indentation. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue24260] TabError behavior doesn't match documentation

2015-05-24 Thread Evgeny Kapun
Evgeny Kapun added the comment: Prohibiting tabs after spaces is not enough. For example, Python rejects this code: if 1: spaceif 1: tabpass because its indentation is invalid if tab width is 1. However, it accepts this code: if 1: tabif 1: 10 spacespass despite its

[issue24260] TabError behavior doesn't match documentation

2015-05-24 Thread Martin Panter
Martin Panter added the comment: 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

[issue24260] TabError behavior doesn't match documentation

2015-05-24 Thread Mark Lawrence
Mark Lawrence added the comment: So when does Python 3 generate this TabError: inconsistent use of tabs and spaces in indentation and when doesn't it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24260

[issue24260] TabError behavior doesn't match documentation

2015-05-23 Thread Stefan Krah
Stefan Krah added the comment: Then pep-008 is wrong, too, since the implementation *does* allow Evgeny's example. The current implementation just checks if the same INDENT/DEDENT tokens are generated for tab widths 1 and 8. -- ___ Python tracker

[issue24260] TabError behavior doesn't match documentation

2015-05-23 Thread Stefan Krah
Stefan Krah added the comment: I would go further and forbid tabs after spaces entirely. Tabs used for indentation with spaces following for formatting are okay (though unusual in Python). -- nosy: +skrah ___ Python tracker rep...@bugs.python.org

[issue24260] TabError behavior doesn't match documentation

2015-05-23 Thread Mark Lawrence
Mark Lawrence added the comment: From https://www.python.org/dev/peps/pep-0008/ quote Tabs or Spaces? Spaces are the preferred indentation method. Tabs should be used solely to remain consistent with code that is already indented with tabs. Python 3 disallows mixing the use of tabs and

[issue24260] TabError behavior doesn't match documentation

2015-05-21 Thread Evgeny Kapun
New submission from Evgeny Kapun: In the documentation, it is said: Indentation is rejected as inconsistent if a source file mixes tabs and spaces in a way that makes the meaning dependent on the worth of a tab in spaces; a TabError is raised in that case. But that's not true. For