In some areas you use tabs for indentation, in other areas you use 4 spaces. As per pep8: https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces Specifically: Python 2 code indented with a mixture of tabs and spaces should be converted to using spaces exclusively.