
Oct. 21, 2019
5:13 p.m.
On Oct 21, 2019, at 09:29, Steven D'Aprano <steve@pearwood.info> wrote:
What did you think it was, if it wasn't a specialised "sum these values" function?
For what it’s worth, I initially thought it was a general fold function, using the magic of optional parameters and operator polymorphism to default to the most common reduction operation for a whole bunch of types. But it only took a few seconds to realize I was wrong. (Although I think this was added not long after new-style classes and the full dunder protocols, so I probably did have fun building a wrapper type that I could pass to sum and use it efficiently as a generic fold function against its will, it was pretty obvious that’s not what it was for.)