On 10 April 2018 at 19:25, Peter O'Connor firstname.lastname@example.org wrote:
Kyle Lahnakoski made a pretty good case for not using itertools.accumulate() earlier in this thread
I wouldn't call it a "pretty good case". He argued that writing *functions* was a bad thing, because the name of a function didn't provide all the details of what was going on in the same way that explicitly writing the code inline would do. That seems to me to be a somewhat bizarre argument - after all, encapsulation and abstraction are pretty fundamental to programming. I'm not even sure he had any specific comments about accumulate other than his general point that as a named function it's somehow worse than writing out the explicit loop.
But in a way that more intuitively expresses the intent of the code, it would be great to have more options on the market.
It's worth adding a reminder here that "having more options on the market" is pretty directly in contradiction to the Zen of Python - "There should be one-- and preferably only one --obvious way to do it".