Closed
Description
My users are high school robotics teams, and the RobotPy project is wrapping a C++ library that uses a lot of inheritance. They keep inheriting from C++ objects, add a constructor without calling the super constructor, it crashes, and they don't really know why at first. It would be great if pybind11 could catch this and throw a python exception instead with a useful error message.
As noted in this stack overflow answer (https://stackoverflow.com/a/46120342), from a metaclass it's possible to call a function after __init__
is called (at least from Python anyways). Has anyone tried customizing the pybind11 metaclass to do this sort of detection?
Metadata
Metadata
Assignees
Labels
No labels