Add option to use tabs instead of spaces #131

glarrain opened this Issue Oct 17, 2012 · 7 comments


None yet

7 participants


While it is not endorsed by PEP8, it does acknowledge many users prefer tab indentation over spaces indentation.

Using this tool, one can disable "W191 indentation contains tabs", but other errors will be raised inappropriately, such as:

  • E122 continuation line missing indentation or outdented
  • E127 continuation line over-indented for visual indent
  • E128 continuation line under-indented for visual indent

The case of "E101 indentation contains mixed spaces and tabs" seems more complex because it is alright for continuations lines but not for regular statements.

What do you think?


I agree the other errors should not be raised.
This is not a priority use case, but I'll be ok to merge a patch with the relevant test cases.


Agree, I'm also using tabs for indenting python code, and pep8 is complaining about it.

Python Code Quality Authority member

So E122 can be triggered by the following.

if True:
$ pep8 --select=E12 E122 continuation line missing indentation or outdented E122 continuation line missing indentation or outdented

But how are E127 and E128 triggered with tabs? The following is fine with respect to E12.

if True:
$ pep8 --select=E12

+1 for this issue. Would be great to see a fix for this issue


+1 I use tabs too and this is quite annoying.


For the records, although I consider tabs a far better semantic solution to indentation than spaces, I think using tabs is just silly in the context of the python ecosystem: there is value in keeping coding standard consistent.

That said, I am obliged to work now with a codebase where somebody above me thinks differently, so I would appreciate if this were fixed.

My specific gripe is with E126 though (continuation line over-indented), that AFAIK should have been fixed in #155. This is the code that triggers the error:

def test_keys(self):
    '''areas.json - All regions are accounted for.'''
    expected = set([
        u'Norrbotten',  # <-------- This line will trigger a E126

This was mostly fixed with #155.

The only remaining issue is E126, which is now tracked with issue #204.

@florentx florentx closed this Mar 24, 2014
@florentx florentx added this to the 1.5.0 milestone Mar 25, 2014
@florentx florentx removed the needs patch label Mar 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment