Skip to content

Auto exclude inherited overrides #101

Description

@kwabenantim

Summary

Currently a pybind11 .def(...) is emitted for every overridden virtual method. However, pybind11 already exposes a base-class binding to derived Python types (and C++ virtual dispatch routes the call to the right override). That means each of these derived bindings is pure duplication.

In large projects, this can add hundreds and thousands of redundant .def(...)s in wrapper code. The current workaround is to exclude these manually in the yaml config. However, it would complicate the config significantly if there are large numbers of such overrides.

A good fix would be to add an exclude_inherited_overrides option that drops the redundant bindings automatically. This shrinks wrappers package-wide with zero additional per-class config.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions