How can you bind exceptions with custom fields and constructors in pybind11 and still have them function as python exception?
问题 This appears to be a known limitation in pybind11. I read through all the docs, whatever bug reports seemed applicable, and everything I could find in the pybind11 gitter. I have a custom exception class in c++ that contains custom constructors and fields. A very basic example of such a class, trimmed for space is here: class BadData : public std::exception { public: // Constructors BadData() : msg(), stack(), _name("BadData") {} BadData(std::string _msg, std::string _stack) : msg(_msg),