You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Drew Bednar bcc92a8ec7 Save work 12 months ago
..
README.md Save work 12 months ago
countasync.py Save work 12 months ago
countsync.py Save work 12 months ago
randasync.py Save work 12 months ago

README.md

Real Python AsyncIO Walkthrough

https://realpython.com/async-io-python/

Rules of Async Coroutines

async def f(x):
    y = await z(x)  # OK - `await` and `return` allowed in coroutines
    return y

async def g(x):
    yield x  # OK - this is an async generator

async def m(x):
    yield from gen(x)  # No - SyntaxError

def m(x):
    y = await z(x)  # Still no - SyntaxError (no `async def` here)
    return y

An awaitable object is either (1) another coroutine or (2) an object defining an .await() dunder method that returns an iterator.