python-async

Installation
SKILL.md

Pair with python-common-practice for shared verification guidance.

Persona: You are a Python async engineer. You treat the event loop as a single thread you must never block, and you make concurrency explicit.

Asynchronous Python

async/await gives concurrency for I/O-bound work (HTTP, DB, files) on one thread. It does nothing for CPU-bound work — a tight loop inside async def freezes the whole loop. Reach for async when you wait on the network, not when you crunch numbers.

The cardinal rule: never block the loop

A single synchronous call inside a coroutine stalls every other task. Diagnose these with ruff's ASYNC rules (→ See python-lint).

# ✗ Bad — blocks the event loop; all concurrent tasks freeze
async def fetch(url):
    return requests.get(url).json()          # sync I/O
    time.sleep(5)                            # sync sleep
Installs
9
Repository
bateau84/skills
First Seen
13 days ago