Message318279
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=[...],
classifier=has_bar),
...
]
```
where `has_foo` and `has_bar` are async functions.
Sometimes it would be useful to combine two functions with
```
Node('node-name',
children=[...],
classifier=async lambda: x: await has_bar(x) or await has_foo(x))
```
If this function was to be an `async def`, rather than `async lambda`, it would have to be defined far away from where it is used. This doesn't always make sense semantically.
I don't think this example on its own is enough to warrant new syntax in the language, but if somebody is collecting "multiple use cases to justify not just using async def first", perhaps it's worth including. |
|
Date |
User |
Action |
Args |
2018-05-31 09:55:25 | thomasahle | set | recipients:
+ thomasahle, terry.reedy, asvetlov, yselivanov, Noah Simon |
2018-05-31 09:55:25 | thomasahle | set | messageid: <1527760525.87.0.682650639539.issue33447@psf.upfronthosting.co.za> |
2018-05-31 09:55:25 | thomasahle | link | issue33447 messages |
2018-05-31 09:55:25 | thomasahle | create | |
|