News for hackers. Stuff that matters.
Re:Format Python Code Using YAPF by mintplant on Sunday February 09, 2020 @05:51AM (#22281488)
I disagree with a few of Black's decisions, so I forked it to Lavender [0], which I keep up to date with the latest stable Black release (and use actively in all my Python projects).

> Differences from Black

> - The default line length is 99 instead of 88 (configurable with --line-length).

> - Single quoted strings are preferred (configurable with --string-normalization none/single/double).

> - Empty lines between classes and defs are treated no differently from other code. The old behavior, which sometimes inserts double empty lines between them, remains available via --special-case-def-empty-lines.

> - The Vim plugin configuration variable for line length is named g:lavender_line_length instead of g:lavender_linelength, for consistency with the other configuration variable names.

[0] https://github.com/spinda/lavender

Re:Format Python Code Using YAPF by akvadrako on Sunday February 09, 2020 @07:27AM (#22281772)
Nice to hear. The single quote issue is the main thing that keeps me from using black. Double quotes are just too noisy.
Re:Format Python Code Using YAPF by jp_sc on Sunday February 09, 2020 @07:42AM (#22281810)
Black can be configured to use single quotes. In fact, I think it's the only style configuration you can make.
Re:Format Python Code Using YAPF by akvadrako on Sunday February 09, 2020 @08:42AM (#22282043)
Re:Format Python Code Using YAPF by 00ajcr on Sunday February 09, 2020 @09:01AM (#22282122)
I think it's the `--skip-string-normalization` flag which means "Don't normalize string quotes or prefixes".
Re:Format Python Code Using YAPF by xapata on Sunday February 09, 2020 @12:50PM (#22283291)
But I want them normalized. Normalized to single quotes.
Re:Format Python Code Using YAPF by dbcurtis on Sunday February 09, 2020 @01:30PM (#22283514)
Yes, this. I have early-stage cateracs, which by-and-latge is not an issue on my 40 inch monitor. But it does mean that my astigmatism drifts around monthly. My prescription changes faster than I can get new lenses cut. The BIGGEST ergonomic issue for my with Python is single versus double quotes. Double quotes are the difference between happily coding all day versus a headache at lunch time and 5% less done. Fuck Black.
Re:Format Python Code Using YAPF by brainbag on Sunday February 09, 2020 @03:30PM (#22284128)
Can you say more about how single quotes vs double quotes is helpful for you? I rarely write python, but I have a passion for accessibility and I'm curious about this.