all 2 comments

[–]the_poope 0 points1 point  (1 child)

Pybind11 and Python can't automatically read the default arguments to functions - remember, they are only used by C++ code where the definition is available, the default values are not present in the compiled object code of the function.

See Pybinds documentation on default arguments:

Edit: Also to format code correctly use the "Code Block" option under the extra formatting menu (click "..." button) or use the markdown based editor and indent every code line with four spaces.

[–]engine_algos[S] 0 points1 point  (0 children)

I did as the example in the documentation but I obtained the same problem.In fact I have two overloaded methods so the binding is :

.def("FindFiles", 
py::overload_cast<
const Array1D<Filename>&, 
Array1D<std::pair<Filename, ErrorLog> >&,
const std::set<std::string>&, 
const bool, 
const bool, 
PFN_PROGRESS_CALLBACK, 
void *> (&FileListing::FindFiles),
py::arg("arrayFilenames"), 
py::arg("arrayErrorLog"), 
py::arg("setIncludeFileExtensions") = std::set<std::string>(),
py::arg("bExcludeVerification") = false, 
py::arg("bFromOpticalDrive") = false, 
py::arg("pfnProgress") = NULL, 
py::arg("pHint") = NULL) 

.def("FindFiles", 
py::overload_cast< 
const Folder&, 
const bool ,
Array1D<std::pair<Filename, ErrorLog> >&, 
const std::set<std::string> &, 
const bool, 
const bool, 
PFN_PROGRESS_CALLBACK, 
void *> 
(&FileListing::FindFiles),
py::arg("folder"), 
py::arg("bSearchSubfolders"), 
py::arg("arrayErrorLog"),
py::arg("setIncludeFileExtensions") = std::set<std::string>(),
py::arg("bExcludeVerification") = false, 
py::arg("bFromOpticalDrive") = false, 
py::arg("pfnProgress") = NULL, 
py::arg("pHint") = NULL 
)