[Python-ideas] Async Lambda syntax

Noah Simon noahs2003 at gmail.com
Fri May 18 16:53:38 EDT 2018


Hello all,
I was developing a script using an asyncio-based API, when I came across the need to define an asynchronous lambda. I found this syntax does not currently exist. Obviously I could have (and did) just write a regular coroutine, but for simple one-line functions and such, I think an asynchronous lambda syntax would be useful. I do not have the experience to write a PEP or implement this, so I was wondering what you all think of the idea.

What I was thinking:

foo = async lambda a, b: b + await bar(a

I posted an issue <https://bugs.python.org/issue33447> on the issue tracker suggesting this, and was directed to this mailing list.

Thanks,
Noah

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180518/d9eb128c/attachment-0001.html>


More information about the Python-ideas mailing list