6 ms·
I use black because it is idempotent. Google's yapf lacks this property. Edit: Previous discussion: https://news.ycombinator.com/item?id=17155048 https://news.
by p0cc 7y ago
I use black because it is idempotent. Google's yapf lacks this property.
Edit: Previous discussion: https://news.ycombinator.com/item?id=17155048 https://news.ycombinator.com/item?id=17155048
- strangemonad 7y agoUnrelated: thank you for using “idempotent” correctly. Too many people use it to mean referential transparency or having a functionality property
- globuous 7y agowooow, so can we think of Black as outputing a projection of your source code in some space ?
- thaumasiotes 7y agoOff 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.
- mlevental 7y agowut? 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) https://en.m.wikipedia.org/wiki/Idempotent_(ring_theory). it's not just characteristic of linear operators.
- CarlsJrMints 7y agoIdempotence means T^2=T. Are you thinking of involution? https://en.wikipedia.org/wiki/Involution_(mathematics) https://en.wikipedia.org/wiki/Involution_(mathematics)
- mlevental 7y agoyou're right i'm wrong. but my saving grace is that they're related https://en.wikipedia.org/wiki/Idempotent_(ring_theory)#Relation_with_involutions https://en.wikipedia.org/wiki/Idempotent_(ring_theory)#Relat...
- quacker 7y agoAgreed. 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.