Terry J. Reedy <tjre...@udel.edu> added the comment:

The only thing special about functions defined with lambda expressions rather 
than def statements is the generic name attribute '<lambda>' instead of a 
specific name.  PEP8 intentionally and properly discourages 'name = lambda ...' 
as inferior to 'def name(...'.

For your example, 

async def foo(a, b): return 5 + await bar(b)

For inline function expressions, as in function calls, the obvious proposals 
would be to reuse 'async' in f(async lambda a, b: ...) or a new keyword, such 
as 'alambda' or 'asynclambda' or ... . Either would need multiple use cases to 
justify not just using async def first.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33447>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to