Here is a block of code from: https://github.com/ronf/asyncssh/blob/master/examples/math_server.py#L38
async def handle_client(process):
process.stdout.write('Enter numbers one per line, or EOF when done:\n')
total = 0
try:
async for line in process.stdin:
line = line.rstrip('\n')
if line:
try:
total += int(line)
except ValueError:
process.stderr.write('Invalid number: %s\n' % line)
except asyncssh.BreakReceived:
pass
There is an async keyword before the def, however there is also one before the for loop. In looking at the documentation for asyncio here: https://docs.python.org/3/library/asyncio-task.html, I do not see any similar uses of this async keyword.
So, what does the keyword do in this context?