DEV Community

Discussion on: Day 3: Attaching Custom Exceptions to Functions and Classes in Python

Collapse
 
stevepryde profile image
Steve Pryde

This is really cool and could be used to clearly denote which exceptions are allowed/expected to be thrown from a particular function or method.

I like it from an ergonomics point of view (import the function and get its exception for free).

Thanks for the tip! :)

Collapse
 
danielfeldroy profile image
Daniel Feldroy • Edited

Just found out I missed a "self" in the class. Added that!