TIL: Exception.add_note (via) Neat tip from Danny Roy Greenfeld: Python 3.11 added a .add_note(message: str)
method to the BaseException
class, which means you can add one or more extra notes to any Python exception and they'll be displayed in the stacktrace!
Here's PEP 678 – Enriching Exceptions with Notes by Zac Hatfield-Dodds proposing the new feature back in 2021.
Recent articles
- LLM 0.27, the annotated release notes: GPT-5 and improved tool calling - 11th August 2025
- Qwen3-4B-Thinking: "This is art - pelicans don't ride bikes!" - 10th August 2025
- My Lethal Trifecta talk at the Bay Area AI Security Meetup - 9th August 2025