[issue33447] Asynchronous lambda syntax

2018-05-31 Thread Thomas Dybdahl Ahle
Thomas Dybdahl Ahle added the comment: Just wanted to add another use-case. In a project I'm working on, we are building a lot of graphs using code like this: ``` nodes = [ Node('node-name1', children=[...], classifier=has_foo), Node('node-name2', children=[

[issue33447] Asynchronous lambda syntax

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: The only thing special about functions defined with lambda expressions rather than def statements is the generic name attribute '' instead of a specific name. PEP8 intentionally and properly discourages 'name = lambda ...' as inferior to 'def name(...'. For

[issue33447] Asynchronous lambda syntax

2018-05-18 Thread Yury Selivanov
Yury Selivanov added the comment: The syntax for async lambdas doesn't look nice and I, personally, don't see that many use cases for them to justify adding new syntax. And this would need a new PEP. I suggest to start a discussion on the Python-ideas mailing list if this is something you

[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon
Noah Simon added the comment: Actually, you wouldn't even need to import asyncio. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon
New submission from Noah Simon : It would be very useful to add an asynchronous lambda syntax, as a shortcut for coroutines. I'm not experienced enough to write a PEP or edit the C source, but I have some ideas for syntax: import asyncio foo = async lambda a,b: 5 + await bar(b) -- com