TIL: Exception.add_note
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story. The source provided limited text, so this summary is brief.
Why it matters
Python developers on 3.11+ can attach extra context to any exception that appears in the stacktrace, making production debugging faster; the impact is small but real.
This is a short tip post by Simon Willison pointing to something Danny Roy Greenfeld shared. Python, the popular programming language, added a feature in version 3.11 called add_note, described in proposal PEP 678 by Zac Hatfield-Dodds back in 2021. It lets a programmer attach extra explanatory messages to an error, and those messages show up in the stacktrace, the report printed when a program crashes. Anyone debugging Python code can benefit.
This is a brief link post highlighting a debugging convenience in Python 3.11: the add_note method on exceptions. Engineers can attach context strings to errors that appear in stacktraces, shortening diagnosis time in production incidents. The feature has existed since 2021's PEP 678, so there is nothing new to buy, adopt or plan for. No cost, competition or risk implications are discussed in the article.
Willison's TIL post, crediting Danny Roy Greenfeld, covers BaseException.add_note(message: str), introduced in Python 3.11 per PEP 678 (Zac Hatfield-Dodds, 2021). It appends one or more note strings to any exception instance, rendered in the traceback output at runtime. The post contains no benchmarks, code examples, or discussion of limitations; it is a pointer to a tip rather than a technical deep dive.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Python 3.11 BaseException PEP 678 add_note Ladybird Datasette
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.