-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pybind11 metaclass to detect when __init__ has not been called from subclass #2103
Comments
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
Apr 5, 2020
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
Apr 5, 2020
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
Apr 5, 2020
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
Apr 5, 2020
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
May 2, 2020
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
Jun 16, 2020
virtuald
added a commit
to robotpy/pybind11
that referenced
this issue
Jun 22, 2020
wjakob
pushed a commit
that referenced
this issue
Jul 7, 2020
EricCousineau-TRI
pushed a commit
to EricCousineau-TRI/pybind11
that referenced
this issue
Aug 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?The text was updated successfully, but these errors were encountered: