pybind / pybind/pybind11

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

Open
#2,813 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

Motivated by post here:
https://github.com/pybind/pybind11/issues/2812#issuecomment-765550126

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the discussion in issue #2812 and the PYBIND11_OVERRIDE* macro usage described here, then compare the referenced Drake example in bindings/pydrake/systems/framework_py_systems.cc with the considerations from issue #1241. Define the desired signature-altering interface and its scope before determining what tests or documentation would demonstrate completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.