-2

I define c++ code here: my_module.def("test", [](const char* s) { auto a = s; }, py::arg("s"));

here is python code: my_module.test(1)

I got the trace: TypeError: test(): incompatible function arguments. The following argument types are supported: 1. (s: unicode) -> None

I want to auto change the int 1 to sting "1", even support float, double...

Key
  • 1

0 Answers0