Yury Selivanov wrote: > Another problem is functions that return future: > > def do_something(): > ... > return fut > > With Greg's idea to call it you would do: > > cocall (do_something())() > > That means that you can't refactor your "do_something" > function and make it a coroutine. There's no fundamental problem with a cofunction returning another cofunction: codef do_something(): return fut f = cocall do_something() result = cocall f() Combining those last two lines into one would require some extra parenthesisation, but I don't think that's something you're going to be doing much in practice. If you're just going to immediately call the result, there's no point in returning a future -- just do it all in do_something(). -- Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4