Skip to main content

pyexception

Attribute Macro pyexception 

Source
#[pyexception]
Expand description

Helper macro to define Exception types. More-or-less is an alias to pyclass macro. A /// comment on the exception type is its docstring and overrides the stored documentation. Use // for developer notes.

This macro serves a goal of generating multiple BaseException / Exception subtypes in a uniform and convenient manner. It looks like SimpleExtendsException in CPython. https://github.com/python/cpython/blob/main/Objects/exceptions.c