Earlier quoted context omitted.
FWIW, ruff sees your line comment and keeps each item on its line. It only adds a trailing comma and additional space. It also does not collapse lines when there’s a trailing comma. Your output seems to be from black. IMO it’s insane to collapse lines when there are line comments. $ uvx ruff format --diff formatting.py --- formatting.py +++ formatting.py @@ -1,8 +1,4 @@ -no_comma = { - "x": 3, - "y": 42, - "z": 2 -}…
(am not the GP) I personally like double quotes, because in so many other languages they are for strings, while single quotes are often for other things. But somehow many people have a single quotes obsession in Python. I am guessing, that it is because of ease of typing them on a US keyboard layout.
Not my problem. My problem is that I want to use them both, as I've been able to for many years.
I'll always use double to surround "can't" and single to surround '8.5" x 14"'. I'll use a context-appropriate pair when adding to existing code. But for all the other cases, I don't want to expend any energy on this. It's a complete non-issue.
> ease of typing them on a US keyboard layout
On both the US and European keyboards single-quotes are easier: no need to press Shift.