4 ms·
That’s definitely possible in Python. Maybe not if you’re using the simplest text editor. But regardless of whether it’s NVIM or Visual Studio Code, you can eas
by Ringz 2y ago
That’s definitely possible in Python. Maybe not if you’re using the simplest text editor. But regardless of whether it’s NVIM or Visual Studio Code, you can easily jump to the end of a line, press Return, and the code will be inserted with the correct indentation. RUFF or BLACK do the rest, and they do it quite intelligently.
- __jonas 2y agoOh interesting, I didn't know! How reliable is it? Does it work well even if you partly copy functions / with blocks etc. ? I just tried it in vscode, it didn't work at all, copy pasted a single line to another function and it kept its indentation and vscode showed a pylance error about unexpected indentation. I just have the official Python extension by Microsoft, perhaps some more configuration is required? I don't really write any Python, I'm sure there is a way to improve the experience.