DEV Community

Cover image for Controlling Python Async Creep

Controlling Python Async Creep

Cristian Medina
Here to find out if deep learning could model a python and power your dockerized gaming AI while cruising in subspace.
Originally published at on ・1 min read

Python added formal asynchronicity in the base language a while ago. It’s fun to play with asyncio tasks and coroutines, the basic constructs that execute almost in parallel. But as you start to integrate more with a regular codebase, you may find that things can get tricky. Especially if you’re forced to interact with synchronous code.

The complication arises when invoking awaitable functions. Doing so requires an async defined code block or coroutine. A non-issue except that if your caller has to be async, then you can’t call it either unless its caller is async. Which then forces its caller into an async block as well, and so on. This is “async creep”.

Read on ...

Discussion (0)