▲ | alain_gilbert 13 hours ago | |||||||
My two mains "why tf is this not built-in" are: "Why are tuple not Hashable ?!" Which means that you cannot have a tuple of Int `(1, 1)` as a key in a dict, and you have to make a struct that implement Hashable instead. And "Why do they not have a `.sum()` and I have to do `.reduce(0, +)` every time instead." Or implement it yourself
| ||||||||
▲ | frizlab 11 hours ago | parent | next [-] | |||||||
I think tuples will be (soon-ish) Hashable but cannot as of now because they want to do it right and need something before they can do it. | ||||||||
▲ | zffr 10 hours ago | parent | prev [-] | |||||||
Why do you feel the stdlib needs a .sum() if using .reduce() is so simple? | ||||||||
|