4 ms·
I think I have a karma with python. Every python project a needed to touch I lost a lot of time dealing with mixed spaces and tabs scattered throughout every so
by rhapsodyv 12y ago
I think I have a karma with python. Every python project a needed to touch I lost a lot of time dealing with mixed spaces and tabs scattered throughout every source file. I really know I am unlucky, this cannot be normal.
- TheLoneWolfling 12y agoHave a save hook that converts everything to <tabs or spaces>.
- pjmlp 12y agoSome of us just use Python friendly editors.
- dalke 12y agoDon't use tabs. See https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces which says to prefer spaces. You can start by converting all tabs into 8 spaces. This can be tricky should some strings have tabs. That's a bad idea in the first place. Use "\t". Don't mix tabs and spaces to get the same indentation level. Python 3 prohibits it. With Python 2 use "-t" or "-tt", which respectively warns and raises an exception if both spaces and tabs are used in the same block.
- rhapsodyv 12y agoYeah, I ended converting all the project to spaces.
- afarrell 12y agoYou are correct that this is not normal. Both sublimetext and vim make this easy to avoid. I recommend sublime