#103 Banish Tab Nanny Hell for Ever


DrPython does not deal very well with tabs. If you are
careful to work with all tabs or all spaces then there
are fewer problems. However, if you have to work with
other people's code or change your mind about what
convention to use then DrPython often complains about
code which is, in fact, correct Python.

The blue squiggly line is often misleading since it
appears on lines following the one which DrPython
thinks is wrong. DrPython should:

1) Ignore the indentation of continuation lines and
block comments.

2) Ignore any white space in blank lines.

3) Ignore white space at the end of lines. For example:
if the colon terminating an 'if' statement is followed
by a blank the following line is not indented as it
should be.

4) Treat consistent indentation as correct regardless
of how it is made up. For example: two tabs and four
spaces is the same as three tabs.

5) When replacing spaces with tabs DrPython should not
change the indentation level od a block of code, For
example: two tabs and three blanks should become three
rather than two tabs.

6) Provide an intelligent operation to reformat
selected code. The error message seems to refer to an
operation that does not exist.

It is not clear why Drpython defaults to using tabs
since there is an ancient design flaw in Unix and other
operating systems. Tabs in a file cannot be interpreted
properly unless that tab positions are also recorded in
the file.


    • status: open --> closed