On Thu, Apr 5, 2018, 5:32 PM Peter O'Connor <peter.ed.ocon...@gmail.com> wrote:
> I find this a bit awkward, and maintain that it would be nice to have this > as a built-in language construct to do this natively. You have to admit: > > smooth_signal = [average = (1-decay)*average + decay*x for x in signal > from average=0.] > > Is a lot cleaner and more intuitive than: > > dev compute_avg(avg, x): > return (1 - decay)*avg + decay * x > The proposed syntax strikes me as confusing and mysterious to do something I do only occasionally. In contrast, itertools.accumulate() is straightforward and far more general. Definitely -100 on the proposal.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/