3 ms·
Exactly. I genuinely do not understand how any significant user of python can handle white space delimitation. You cannot copy or paste anything without busywor
by rao-v 7mo ago
Exactly. I genuinely do not understand how any significant user of python can handle white space delimitation. You cannot copy or paste anything without busywork, your IDE or formatter dare not help you till you resolve the ambiguity.
One day https://github.com/mathialo/bython https://github.com/mathialo/bython one day!
- silon42 7mo agolooks cool.. Alternatively, I've several times used 'pass' as block terminator for my personal code.
- xigoi 7mo ago> You cannot copy or paste anything without busywork Sounds like a tool issue. My editor (Neovim with a few plugins) can handle copying/pasting with indentation just fine.
- eviks 7mo ago> your IDE or formatter dare not help you Get the ones that do help you! Problem solved, enjoy your clean reading experience!
- rao-v 7mo agoThe problem is that if you copy random code from the internet it cannot figure out the right indentation level - whitespace has meaning in python. What IDE can automagically handle this?
- eviks 7mo agoDo you mean "figure out that I'm pasting at level 3, so all pasted code should have +3 levels of indents" like plugins like this one do? https://marketplace.visualstudio.com/items?itemName=hyesun.py-paste-indent https://marketplace.visualstudio.com/items?itemName=hyesun.p... (Sublime has the same, so does vim see comment above, so do many real IDEs) Or do you mean something different?
- rao-v 7mo agoThis is nice, but it's not always the case that +3 indent is the right solution (e.g. if I'm copying already indented code it may be over indented). It's basically a non problem in most other languages, and a IDE formatter hook will always clean up the code and organize it correctly in a way that you cannot get in Python.
- eviks 7mo agoHave you not used any of such IDEs/plugins? It's not X+3 indent, it's "starting at +3", so if you have lines with +10 indent (overindented) copied and paste them at +3 indent, they all get indents cut by 7 levels and end up at the same +3 level as expected.