Skip to content

Broken mro when using multiple inheritance with py::metaclass #597

Description

@pschella

When a derived class MroDerived needs to expose a static attribute (which necessitates using py::metaclass), but also inherits from multiple bases Python raises the following error:

ImportError: MroDerived: PyType_Ready failed (TypeError: mro() returned base with unsuitable layout ('pybind11_tests.MroBaseB'))!

For a complete example see https://github.com/lsst-dm/pybind11/tree/broken_mro

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions