From 196cb5dc45a9819c8c654a67c4370491dc26f673 Mon Sep 17 00:00:00 2001 From: Rick Poyner Date: Wed, 9 Oct 2024 18:22:40 -0400 Subject: [PATCH] wip: do build apis --- bindings/pydrake/systems/framework_py_semantics.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bindings/pydrake/systems/framework_py_semantics.cc b/bindings/pydrake/systems/framework_py_semantics.cc index 9bdc3a870811..4f3806551fec 100644 --- a/bindings/pydrake/systems/framework_py_semantics.cc +++ b/bindings/pydrake/systems/framework_py_semantics.cc @@ -683,12 +683,10 @@ void DoDefineFrameworkDiagramBuilder(py::module m) { .def("ExportOutput", &DiagramBuilder::ExportOutput, py::arg("output"), py::arg("name") = kUseDefaultName, py_rvp::reference_internal, doc.DiagramBuilder.ExportOutput.doc) - .def("Build", &DiagramBuilder::Build, - // Keep alive, ownership (tr.): `self` keeps `return` alive. - py::keep_alive<1, 0>(), doc.DiagramBuilder.Build.doc) + .def("Build", &DiagramBuilder::Build, internal::ref_cycle<1, 0>(), + doc.DiagramBuilder.Build.doc) .def("BuildInto", &DiagramBuilder::BuildInto, py::arg("target"), - // Keep alive, ownership (tr.): `target` keeps `self` alive. - py::keep_alive<2, 1>(), doc.DiagramBuilder.BuildInto.doc) + internal::ref_cycle<2, 1>(), doc.DiagramBuilder.BuildInto.doc) .def("IsConnectedOrExported", &DiagramBuilder::IsConnectedOrExported, py::arg("port"), doc.DiagramBuilder.IsConnectedOrExported.doc) .def("num_input_ports", &DiagramBuilder::num_input_ports,