Hacker News new | comments | show | ask | jobs | submit login
[flagged]
slyzmud 120 days ago | hide | past | web | favorite



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.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: