Message317061
| 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 | <1526679844.17.0.682650639539.issue33447@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-05-18 21:44:04 | terry.reedy | set | recipients: + terry.reedy, asvetlov, yselivanov, Noah Simon |
| 2018-05-18 21:44:04 | terry.reedy | set | messageid: <1526679844.17.0.682650639539.issue33447@psf.upfronthosting.co.za> |
| 2018-05-18 21:44:04 | terry.reedy | link | issue33447 messages |
| 2018-05-18 21:44:04 | terry.reedy | create | |