Author terry.reedy
Recipients Noah Simon, asvetlov, terry.reedy, yselivanov
Date 2018-05-18.21:44:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.
Date User Action Args
2018-05-18 21:44:04terry.reedysetrecipients: + terry.reedy, asvetlov, yselivanov, Noah Simon
2018-05-18 21:44:04terry.reedysetmessageid: <>
2018-05-18 21:44:04terry.reedylinkissue33447 messages
2018-05-18 21:44:04terry.reedycreate