▲ | pansa2 9 days ago | ||||||||||||||||||||||||||||
> This is how Python has always been. Nah, idiomatic Python always used to prefer comprehensions over explicit loops. This is just the `match` statement making code 3x longer than it needs to be. | |||||||||||||||||||||||||||||
▲ | the-grump 8 days ago | parent [-] | ||||||||||||||||||||||||||||
You can express the loop as a list comprehension, and I would too. As for the logic, I would still use pattern matching for branching and destructuring, but I’d put it in a helper. More lines is not a negative in my book, though I admit the thing with convert and format is weird. | |||||||||||||||||||||||||||||
|