News for hackers. Stuff that matters.
Re:Black – Uncompromising Python code formatter by p0cc on Friday May 17, 2019 @11:52AM (#19940746)
I use black because it is idempotent. Google's yapf lacks this property.

Edit: Previous discussion: https://news.ycombinator.com/item?id=17155048

Re:Black – Uncompromising Python code formatter by strangemonad on Friday May 17, 2019 @12:40PM (#19941236)
Unrelated: thank you for using “idempotent” correctly. Too many people use it to mean referential transparency or having a functionality property
Re:Black – Uncompromising Python code formatter by globuous on Friday May 17, 2019 @08:29PM (#19944822)
wooow, so can we think of Black as outputing a projection of your source code in some space ?
Re:Black – Uncompromising Python code formatter by thaumasiotes on Friday May 17, 2019 @09:03PM (#19944954)
Off the top of my head, sure, you could think of things that way, but I don't see that you get a lot out of that framing.
Re:Black – Uncompromising Python code formatter by mlevental on Saturday May 18, 2019 @06:28PM (#19950068)
wut? idempotent is any operator T such that T^2=e the identity. for example ring elements can be idempotent https://en.m.wikipedia.org/wiki/Idempotent_(ring_theory). it's not just characteristic of linear operators.
Re:Black – Uncompromising Python code formatter by CarlsJrMints on Sunday May 19, 2019 @01:43PM (#19954431)
Idempotence means T^2=T. Are you thinking of involution? https://en.wikipedia.org/wiki/Involution_(mathematics)
Re:Black – Uncompromising Python code formatter by mlevental on Sunday May 19, 2019 @01:47PM (#19954467)
you're right i'm wrong. but my saving grace is that they're related https://en.wikipedia.org/wiki/Idempotent_(ring_theory)#Relat...
Re:Black – Uncompromising Python code formatter by quacker on Friday May 17, 2019 @04:47PM (#19943414)
Agreed. yapf has soo many config options, and I want to say some of those options are heuristics (like `SPLIT_PENALTY_AFTER_OPENING_BRACKET`) which can have some "unpredictable" side effects (at least to the eyes of a new user).

I prefer Black, which has minimal configuration. There's no debate to be had over details that don't matter much in the grand scheme of things. Yeah, maybe it doesn't always look _just_ how I'd like, but I get used it.

And while Black may not be 100% compatible with flake8 out of the box, they are aware of flake8 and document places where it may not be flake8-compatible.