ages ago @zo1, I do see similar problems now if I shift from *nux/vim toolchain to win/idle which by default uses 'Python standard: 4 spaces!' but still throws random format error parsing on default code edits.
I don't like the fact python code stops working randomly if I write it in one environment then touch (edit) in another. Never have this problem with C or JS.
I have only ever had issues like that when I worked on an actual Python checker where I had to keep BAD code in my tests to ensure the checks worked.
I've never ( read 99.999% of the time I've performed the task ) had issues with Python formatting that weren't my own fault, everyone makes mistakes after all. I routinely edit the same Python files in Vim, Nano, Sublime Text, Atom, and PyCharm, and even jumping between all those editors, they have never "damaged" the formatting and created syntax errors in my code.
I can only surmise that some of the things you used or even just your vim config was setup poorly for Python work.
" I routinely edit the same Python files in Vim, Nano, Sublime Text, Atom, and PyCharm, and even jumping between all those editors, they have never "damaged" the formatting and created syntax errors in my code."
I don't like the fact python code stops working randomly if I write it in one environment then touch (edit) in another. Never have this problem with C or JS.