diff --git a/python_binding/operator/pybind_GenericOperator.cpp b/python_binding/operator/pybind_GenericOperator.cpp index ad724f3d30da63b3f92e611f2d2a17e0584d44eb..2b627be41a022b7be5e788a19a5e7518b15d65cb 100644 --- a/python_binding/operator/pybind_GenericOperator.cpp +++ b/python_binding/operator/pybind_GenericOperator.cpp @@ -33,14 +33,17 @@ void init_GenericOperator(py::module& m) { IOIndex_t nbData, IOIndex_t nbParam, IOIndex_t nbOut, - const std::string& name = "", - const py::kwargs kwargs) { + const py::kwargs kwargs){ + std::string name = ""; + if (kwargs.contains("name")) { + name = kwargs["name"].cast<std::string>(); + } std::shared_ptr<Node> genericNode = GenericOperator( type, nbData, nbParam, nbOut, - name + std::move(name) ); if (kwargs){ std::shared_ptr<GenericOperator_Op> gop = std::static_pointer_cast<GenericOperator_Op>(genericNode->getOperator());