TLDRocket
Sign in

Introducing wrapture

Simon Willison’s Weblog Simon Willison

Graham Dumpleton released Wrapture, a new Python tool that can trace or override functions. It matters because it can watch code without changing it, and its own code was written by an AI assistant.

Based on reporting by Simon Willison’s Weblog, Simon Willison — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Graham Dumpleton has put out Wrapture, a new Python library that takes the monkeypatching ideas behind wrapt and stretches them across testing and tracing at once. The pitch is simple enough: wrap a function or method, watch everything that passes through it, or swap in a different return value when needed.

That makes it useful in two directions. On one side, it works as an alternative to unittest.mock for tests. On the other, it gives you a way to attach tracing to code you don’t control, so you can record what flows through it without disturbing the program under observation.

Wrapture also includes OpenTelemetry support, plus a configuration-only setup for adding tracing to an existing Python project. Graham shows that with a compact config snippet that defines a summary capture, observes a Calculator target, and sends output to JSON lines in trace.jsonl.

The project is only a few weeks old, so this is early days. But there’s a more unusual detail here: every line of code and documentation in wrapture was written by an AI assistant under Graham’s direction. He is careful to draw a line between that and vibe coding, saying this was engineered deliberately by someone who already knew exactly what the result needed to be.

My take — AI-written commentary, not fact-checked reporting

This is the useful version of AI-assisted coding: a domain expert steering a tool, not a prompt goblin hoping for magic. The industry keeps pretending those are the same thing, which is how you get noisy demos and broken software. Wrapture looks more like the future than the hype reels do, and that alone is refreshing.

Read more about this at: Simon Willison’s Weblog

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.