Skip to content
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

Adding wrapper code for already wrapped types #27

Open
muffgaga opened this issue Dec 16, 2019 · 0 comments
Open

Adding wrapper code for already wrapped types #27

muffgaga opened this issue Dec 16, 2019 · 0 comments

Comments

@muffgaga
Copy link
Contributor

struct GENPYBIND(visible) TopLevel
{
    // already wrapped somewhere else
    typedef SomeComponents some_type GENPYBIND(opaque);

    GENPYBIND_MANUAL({
        auto ism = parent->py::is_method(attr);
        auto attr = parent.attr("some_type");
        attr.attr("to_numpy") = parent->py::cpp_function(/* code */, ism);
    })
};

In some cases it might be nice to modify the wrapper code of some element contained in the wrapper code of a TopLevel class instead of adding the member dynamically via attr.

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

No branches or pull requests

1 participant