Skip to content

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

Closed
@pschella

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

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