News for hackers. Stuff that matters.
Re:Asynchronous Programming in Python: Asyncio by pdonis on Monday May 01, 2017 @04:44PM (#14241381)
A partial function in Python is just a wrapper around the underlying function, that automatically supplies whatever arguments you passed in to functools.partial. It doesn't change anything about how the function is executed.

A coroutine gets executed differently from an ordinary function (or an ordinary generator, for that matter); when you call it using the await syntax, the Python interpreter can choose to run some other code while it is waiting for your function to return a result from I/O (for example, a network request). A normal function call doesn't allow that. (A generator might, if you use yield from and do a number of other things, but you have to do them by hand, whereas the await syntax does it all for you automatically inside the interpreter.)

Re:Asynchronous Programming in Python: Asyncio by ATsch on Monday May 01, 2017 @08:06PM (#14242919)
This is slightly misleading considering async funcions are just simply generators and nothing but parsing the keywords is actually implemented in the interpreter. The whole logic is in the asyncio library.

This is a great talk where the presenter goes into how asyncio works in detail and builds a mini version of the asyncio library:

https://youtu.be/M-UcUs7IMIM

Re:Asynchronous Programming in Python: Asyncio by pdonis on Monday May 01, 2017 @08:10PM (#14242940)
> async funcions are just simply generators and nothing but parsing the keywords is actually implemented in the interpreter.

As I understand it, async functions have an extra flag that ordinary generators don't have, and the interpreter does some different things if that flag is present. But I have not dug deeply into the source code.