Re:Guido was right, there should be no lambda in Python (2018)
by hsbauauvhabzb on Tuesday September 27, 2022 @09:17PM
(#33003218)
I find it odd that this isn’t a configuration option in any/all language compilers. I prefer indents to braces, but understand the hate others have. Turns out AST engines could convert them relatively easily.
[ Parent
| on HN ]
Re:Guido was right, there should be no lambda in Python (2018)
by p1necone on Tuesday September 27, 2022 @10:05PM
(#33003490)
A lot of languages do have auto formatters with opinionated defaults for this.
For go, gofmt is so opinionated that you can't even configure it, which is kinda cool because it means all go code that uses it will look the same.
There's also rustfmt for rust and prettier for JS/TS (and I assume similar for lots of other languages I'm not familiar with), both of which are configurable, which I prefer - but I can see the upsides of a one-size-fits-all code formatting tool (especially for a language like go where a reasonably constrained feature set/syntax is an explicit goal of the language).
Re:Guido was right, there should be no lambda in Python (2018)
by occamrazor on Wednesday September 28, 2022 @07:24AM
(#33006700)
Python has black, also not configurable.
Re:Guido was right, there should be no lambda in Python (2018)
by avryhof on Wednesday September 28, 2022 @10:23AM
(#33008308)
Black is pretty nice with the defaults, but it certainly is configurable these days.
It can take command line options, or it can be configured in your Poetry pyproject.toml file.
https://black.readthedocs.io/en/stable/usage_and_configurati...