[Python-ideas] Query about proposed Multi-line Anonymous Function syntaxes

Guido van Rossum guido at python.org
Fri Oct 10 20:42:56 CEST 2014


On Fri, Oct 10, 2014 at 8:06 AM, Adam Jorgensen <adam.jorgensen.za at gmail.com
> wrote:

>
> So, as I understand it, the main reason we don't have multi-line anonymous
> functions is because there has been no consensus about
> the syntax.
>

Well, it's worse -- it's hard to propose a syntax that actually works
without huge changes to the way Python's parser treats indentation: inside
parentheses, indentation is currently *not* significant.


> I was just wondering if someone has a document detailing the various
> syntaxes that have been proposed in the the past.
>

No, but there have been many discussions. If you have a taste for mailing
list archaeology it would be nice of you could dig up the various threads
and summarize them for posterity, so at least we might make progress rather
than going around in circles.

As for myself, I have encountered a number of languages that do support
multi-line anonymous functions (Java, JavaScript, CoffeeScript) and I have
to say that for some reason they do not lead to very readable code.
Especially in the latter two, the prevalent use for anonymous functions is
for asynchronous I/O callbacks. I find Python 3.4's "yield from" as used by
the asyncio library leads to much more readable code, without he need for
callback functions at all.
-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141010/313aaa85/attachment.html>


More information about the Python-ideas mailing list