Search CTRL + K

Python asyncio blocking analysis

#python #asyncio #static-analysis

This page explores solutions to asyncio's blocking call problem

We'd like to statically analyze a codebase to identify calls to blocking functions inside an async context. The shape of the solution is likely a plugin for mypy or a standalone CLI tool.

The tool would ideally satisfy the following requirements:

Some stuff for me to figure out before designing a solution:

This GitHub discussion goes over most of these issues and suggests a few ways to enable mypy to help with this problem.