-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Milestone
Description
Let's add support for
npe_class(PythonClassName, cpp::MyClass)
npe_init()
npe_arg(a, dense_f32, dense_f64)
npe_arg(b, npe_matches(a))
npe_begin_code()
return cpp::MyClass(a, b);
npe_end_code()
npe_method(foo)
npe_arg(a, dense_f32, dense_f64)
npe_begin_code()
return npe_self.foo(a);
npe_end_code()
npe_end_class()
This is definitely more overhead in terms of boilerplate than pybind11 since we aren't auto wrapping methods. We could also have an automatic mode that looks like:
npe_auto init(PythonClassName, cpp::MyClass, arg1, ..., argN)npe_auto_method(PythonMethodName, cpp:MyClass::method)