Skip to content
Snippets Groups Projects
Commit 1245c82d authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Add clarity to note on why we use a trampoline to bind add_child.

parent d1fd75fd
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,8 @@ void init_Node(py::module& m) {
[](Node &self, std::shared_ptr<GraphView> other_graph, const IOIndex_t out_id=0,
py::object other_in_id = py::none()) {
std::pair<NodePtr, IOIndex_t> cpp_other_in_id;
// Note: default arg nullptr to allow python binding
// Note: PyBind on windows does not support conversion of nullptr -> std::shared_ptr, using this trampoline to change the default arg to a py::none(). If signature change, we would be able to directly bind the function.
if (other_in_id.is_none()) {
cpp_other_in_id = std::pair<NodePtr, IOIndex_t>(nullptr, gk_IODefaultIndex);
}else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment