Skip to content

Commit eefd2ae

Browse files
1 parent 5792e68 commit eefd2ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doxygen_cxx/group__python__bindings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ <h3>Clone Methods</h3>
339339
<p>In the cases of (a) and (c), <code>pybind11</code> provides sufficient mechanisms to provide an unambiguous output return type. However, for (b), <code>pybind11</code> will return <code>ndarray</code> with shape <code>(3,)</code>. This can cause an issue when users pass a vector of shape <code>(3, 1)</code> as input. Nominally, pybind11 will return a <code>(3,)</code> array, but the user may expect <code>(3, 1)</code> as an output. To accommodate this, you should use the <a class="el" href="namespacedrake_1_1pydrake.html#af5f81d7315477aaa1694d9aa02a1346b" title="Wraps a overload instance method to reshape the output to be the same as a given input argument.">drake::pydrake::WrapToMatchInputShape</a> function.</p>
340340
<dl class="section see"><dt>See also</dt><dd><a href="https://github.com/RobotLocomotion/drake/issues/13885">https://github.com/RobotLocomotion/drake/issues/13885</a></dd></dl>
341341
<h2>Python Subclassing of C++ Classes</h2>
342-
<p>In general, minimize the amount in which users may subclass C++ classes in Python. When you do wish to do this, ensure that you use a trampoline class in <code>pybind</code>, and ensure that the trampoline class inherits from the <code>py::wrapper&lt;&gt;</code> class specific to our fork of <code>pybind</code>. This ensures that no slicing happens with the subclassed instances.</p>
342+
<p>In general, minimize the amount in which users may subclass C++ classes in Python. When you do wish to do this, ensure that you use a trampoline class in <code>pybind</code>.</p>
343343
<p><a class="anchor" id="PydrakeBazelDebug"></a></p><h1>Interactive Debugging with Bazel</h1>
344344
<p>If you are debugging a unitest, first try running the test with <code>--trace=user</code> to see where the code is failing. This should cover most cases where you need to debug C++ bits. Example: </p><pre class="fragment">bazel run //bindings/pydrake/systems:py/lifetime_test -- --trace=user
345345
</pre><p>If you need to debug further while using Bazel, it is suggested to use <code>gdbserver</code> for simplicity. Example:</p>

0 commit comments

Comments
 (0)