2 comments

[ 5.8 ms ] story [ 23.5 ms ] thread
Offensively misleading title. This is just the work-in-progress "what's new" changelog for 3.7, currently in alpha.
From the release notes, it looks like this was mostly cleanup.

The one interesting thing I see is the @asynccontextmanager decorator.

    from contextlib import asynccontextmanager

    @asynccontextmanager
    async def get_connection():
        conn = await acquire_db_connection()
        try:
            yield
        finally:
            await release_db_connection(conn)

    async def get_all_users():
        async with get_connection() as conn:
            return conn.query('SELECT ...')
Like the demo, the biggest thing I'd use for this is database connections and requests. But as far as I know, support in SQLAlchemy for async connections is weak. Does anybody know more about that? I know of aiopg for Postgres.