| Async def are not colored functions in python. In fact there are not function at all, just like generators are not. Also coroutines can be called from functions and vice versa. You don't have to choose. The problem is not the color. The problem is the default paradigm is to be blocking I/O, and you add non blocking on top. It's way easier to make everything non blocking, then add blocking things on top. It's not a matter of syntax, but of core paradigm. Go and erlang were designed from the non blocking perspective from the get go. But even go add to use something to manage async control flow, so it uses channels, which you don't need if you have coroutines. Erland went deeper and made everything immutable, and baked in actors in the runtime. To me that's more impressive. |
I might use this test: When I wish to add a call to a function that yields control other than by returning to the middle of a regular function, so that the latter portion of the regular function can use the results of yielding, do I then have to change the function declaration and every single call site?
You clearly disagree. What test should we use?