4 ms·
There is nothing wrong with properly indenting code. The lack of {} makes python very ugly when things no longer fit on one line. Because Python has an opinion
by cjfd 3y ago
There is nothing wrong with properly indenting code. The lack of {} makes python very ugly when things no longer fit on one line. Because Python has an opinion about whitespace there are certain ways one can break a line an other ways one cannot. The result looks very ugly. Maybe the old way of using a backslash was not the worst, but linters nowadays don't like that anymore. Also having : also does not make things look better. Python must be one of the most ugly looking languages out there.
- giancarlostoro 3y ago> when things no longer fit on one line That sounds like a PEP-8 violation ;) All your lines should be under 79 characters. Might look ugly to some but to others it looks fine.
- housecarpenter 3y agoYou might be already aware of this, but besides using the backslash, the other way you can allow an expression to span multiple lines in Python is to enclose it in brackets. I find this to be pretty unobtrusive. Often your line break will already be within a pair of brackets anyway.
- xigoi 3y agoBlack can usually reformat code pretty well.