[Jonathan Fine]

> one of the messages had a link to still live and excellent page
> > https://wiki.python.org/moin/AlternateLambdaSyntax
> This page lists over 100 suggestions, mostly variants. So far as I can
> see, my simple proposal isn't listed on that page. The page also says


Awesome!

Unfortunately the links to conversations seem to all be broken!

Most of the links are from December 2004, so I pulled up the discussion for
that month
<https://mail.python.org/pipermail/python-list/2004-December/subject.html#start>
and searched "lambda"

I was able to find what I believe is reference [1]:
https://mail.python.org/pipermail/python-list/2004-December/264515.html

It looks like the post numbers got mangled...

Anyway, it looks like that page covers December 2004-June 2005, I found a
few nuggets of opposition:

https://mail.python.org/pipermail/python-list/2004-December/247348.html

https://mail.python.org/pipermail/python-list/2004-December/273038.html

I sort-of understand the opposition to multi-line anonymous functions, but
I think the Terry Reedy (in the second link)
is a bit too dismissive of the concept of anonymous functions.

I don't work with user-interfaces a lot, but when I do; I can see why UI
coders use anonymous functions so much.
Defining a function in a statement can be far less expressive and far more
noisy than in an expression.
It's like: I'll tell you my solution, but first let me shave this Yak here.

You're defining often one-off functions before describing what you're going
to use it for.
It's only after you actually pass them to an event-watcher that the context
of their logic is clear.
For instance:

>>> def handler(event):  # First, let me tell you about a function
...     <shave yak with event>  # It's a 1-off with a throw-away name
...     return result  # You'll see what I need it for later...
...
>>> ui_element.on_mouseover(handler)

vs.

>>> # lack of noisy preamble to your code
>>> ui_element.on_mouseover(<what to do> with event)

The anonymous function is given meaning by virtue of the context in-which
it's defined.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to