Where is this meme from?
verstra
He is a little confused, but he got the spirit
Yeah, that's true, auto formatters will always have cases which format weirdly and have a nicer alternative.
But in the end, the formatting does not matter much, so we all benefit for it being formated one way, and one way only.
How would you format on git server? Create commits automatically, or ammend commits on push?
It looks like Hack?
Well, I'm saying that we could design a language where code would have to be formatted, so it would not be up to the project leader, at least syntactically.
I strongly believe that code formatting does not hold any information and that because of it, compilers should reject non-normalized code, saying "run a formatter first". We have the tooling for most of the languages to make this absolutely painless, remove all head scratching of "what the hell is up with this code style" and just focus of the semantics. I believe that you should be allowed to produce code abominations like this code sample and have it auto-formatted into the code style that everyone can easily interpret.
People designing Python surly didn't think of this. And when they see this now, the reaction would probably be "this should not be in any codebase, ever". But it can be. It is valid Python.
And it's a consequence of pushing features like unpacking and array comprehension and slice assigning and f-strings without fully exploring how they will interfere. One could argue that Python would be better of without some of these features.
But I don't blame them - exploring all possible combinations of features is just too much. The number of combinations grows exponentially and even if you have a fuzzer generating all possible expressions, you don't have enough time in your life to review all of the combinations.
I agree on basically all points. Great article, nicely explained.