3 ms·
Black for Python https://github.com/psf/black https://github.com/psf/black
by mholm 2mo ago
Black for Python
https://github.com/psf/black https://github.com/psf/black
- rsyring 2mo agoBut you're probably better off with Ruff these days: https://docs.astral.sh/ruff/ https://docs.astral.sh/ruff/ Similar to black but faster, written in Rust, by the same team who created uv.
- marcus_holmes 2mo agoSo... A: not trivial. And B: not part of the language. > mean this isn't true, formatting is the most trivial part. And so many languages have an opinionated formatter these days (e.g. Black) I don't think this is correct
- pmarreck 2mo agoB: not part of the language. 1) Some would call this a perk. 2) When your tooling around a language works better when it's not actually written in the language... That should tell you something. And yet...
- frollogaston 2mo agoThis back-and-forth is a good example of why Go benefits from having a centralized linter. And uv isn't the official Python package manager even though it should be.
- maleldil 2mo agoI don't get why this is a big issue. This isn't some recurrent decision to be made. It's something a lead decides once and the project follows. That's it. Many companies have style guides anyway (eg Google[1]); the choice of a formatter is much simpler. [1] https://google.github.io/styleguide/go/ https://google.github.io/styleguide/go/
- frollogaston 2mo agoBecause at some point you have to interact with some other team or project that made a different decision. And whatever you picked might fall out of favor and lose support. There's already a graveyard of Python type linters, including Google's pytype. Especially the uv thing. You clone some non-uv git repo that has no pyproject.toml and you don't know what to install. Maybe has requirements.txt but it's partially wrong.