Simon Willison’s Weblog

Subscribe

Entries tagged plugins, async

Filters: Type: entry × plugins × async × Sorted by date


The “await me maybe” pattern for Python asyncio

I’ve identified a pattern for handling potentially-asynchronous callback functions in Python which I’m calling the “await me maybe” pattern. It works by letting you return a value, a callable function that returns a value OR an awaitable function that returns that value.

[... 787 words]

Types

Years

Tags