[Python-ideas] Reduce/fold and scan with generator expressions and comprehensions

Chris Angelico rosuav at gmail.com
Sun Oct 23 20:38:52 EDT 2016


On Mon, Oct 24, 2016 at 11:29 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> In fairness I am sick and if I were well I may have been able to keep
> this straight in my head, but calling the variable "prev" is actively
> misleading. I was mislead, and (I think) Chris who just suggested this
> was similar to the SQL "lag" function may have been mislead as well. (Or
> perhaps he was just mislead by me, in which case, sorry Chris!)

All of the above are possible. I'm skimming the thread, not reading it
in full, and I'm a bit lost as to the point of the proposal, so it's
entirely possible that lag() is unrelated.

But if it is indeed just reduce(), then it's even simpler.

ChrisA


More information about the Python-ideas mailing list