[Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

Paul Moore p.f.moore at gmail.com
Wed Apr 11 10:50:59 EDT 2018


On 11 April 2018 at 15:37, Peter O'Connor <peter.ed.oconnor at gmail.com> wrote:

> If people are happy with these solutions and still see no need for the
> initialization syntax, we can stop this, but as I see it there is a "hole"
> in the language that needs to be filled.

Personally, I'm happy with those solutions and see no need for the
initialisation syntax.

In particular, I'm happiest with the named moving_average() function,
which may reflect to some extent my lack of familiarity with the
subject area. I don't *care* how it's implemented internally - an
explicit loop is fine with me, but if a domain expert wants to be
clever and use something more complex, I don't need to know. An often
missed disadvantage of one-liners is that they get put inline, meaning
that people looking for a higher level overview of what the code does
get confronted with all the gory details.

Paul


More information about the Python-ideas mailing list