Skip to content

[FEAT] Easier way to alter function signatures for PYBIND11_OVERRIDE*? #2813

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

Open
EricCousineau-TRI opened this issue Jan 22, 2021 · 2 comments

Comments

@EricCousineau-TRI
Copy link
Collaborator

Motivated by post here:
#2812 (comment)

One minor pain point I've ran into is wrapping calls to PYBIND11_OVERRIDE* macros.

We've worked around in Drake, but it ain't pretty. Example (older fork of pybind11, so you'll need to munge the names):
https://github.com/RobotLocomotion/drake/blob/6ee5e9325821277a62bd5cd5456ccf02ca25dab7/bindings/pydrake/systems/framework_py_systems.cc#L110-L159

As mentioned in the code, part of the reason for this was #1241 (return values, const lvalues, etc.).

\cc @YannickJadoul

@YannickJadoul
Copy link
Collaborator

Aren't such more complicate use cases why there is a (public) pybind11::get_override?

I agree the PYBIND11_OVERRIDE* macros are (very) limited, but the problem is adding extra macros might be horrible, if we don't wish to combinatorially explode the number of macros? :-(

Just thinking out loud: one option would be to add an example to the docs on how to use py::get_override. But I'm open/curious if you have something specific in mind, perhaps?

@EricCousineau-TRI
Copy link
Collaborator Author

\cc @rwgk @rhaschke for #2916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants