3 ms·
Until you refactor some python code and the indentation gets messed up without you noticing... Been there, done that. And unlike languages with explicit begin/
by tobiasu 14y ago
Until you refactor some python code and the indentation gets messed up without you noticing... Been there, done that.
And unlike languages with explicit begin/end markers, an editor can't re-format it or warn about it, because there is no information to work with.
- pekk 14y agoPerhaps you didn't understand, but that doesn't happen when you set up your editor. Anyone who actually uses Python spends 0% CPU thinking about soft tabs because the editor is already set up to deal with this and almost everyone uses soft tabs, as suggested by PEP8.
- qu4z-2 14y agoThere's no reason an editor can't reformat most cases. If you copy a block of text out of one indentation-level and into another, you simply need to adjust the leading indents by a fixed amount. Obviously if you're changing which statements are or are not part of a block and thus need to re-indent things per-line you'll need to do it manually, but you'd also need to manually move the braces around, and it'd be less obvious if you forgot.