Cloudflare makes Python Workers generally available, with native bindings and DB drivers
Cloudflare has promoted Python Workers to general availability, two years after first letting developers run Python inside its edge Workers runtime. Python is now a first-class language on the platform: developers can wire their code directly into services like Workers AI, R2, D1, Hyperdrive, Durable Objects, and Queues, and run mainstream frameworks such as FastAPI, Django, and Flask. The runtime relies on Pyodide, a WebAssembly-compiled Python interpreter, which Cloudflare has been able to use because Workers has supported Wasm since 2018.
The headline improvement is the removal of the JavaScript glue that previously leaked into Python code. Bindings once required manually converting Python objects into JS objects at the RPC boundary — a frequent source of bugs for both developers and AI coding agents. That conversion now happens inside the runtime and SDK, so calls like sending a dictionary to a Queue work with plain Python. For web apps, thin ASGI and WSGI connectors translate incoming requests into the standard interfaces frameworks expect, letting Cloudflare’s network act as the web server rather than running Uvicorn or Gunicorn inside each Worker.
Cloudflare also solved a long-standing blocker for database access. Because Wasm sandboxes stub out POSIX networking syscalls, drivers like asyncpg and aiomysql that depend on the socket module simply failed. Cloudflare reimplemented socket calls on top of the Workers connect API, translating them at the syscall level so unmodified drivers can open TCP connections. That socket bridge underpins Hyperdrive integration, giving Python Workers access to PostgreSQL and MySQL. The company frames the release as a step toward a platform for infinitely scalable Python apps that behave like Python does everywhere else.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.