The Real Python Podcast cover image

Exploring the New Features of Python 3.11

The Real Python Podcast

00:00

Using Peg Parsers to Trace Exceptions

There are two new features connected to exceptions. One is notes and the other is groups. It's a small thing, but it's kind of handy. And essentially what they've done is added an attribute to exception objects that stores a little message called a note. The idea is if you catch an exception and you want to add some information before re-raising it, you can call add note on the exception as a method. So yeah, there are certain cases where this can make a big difference visually. Anything where you can tell your users, give it your users a little better hint or your self as a developer is always a good thing.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app