Skip to content

Commit

Permalink
Extend classh note to explain whitespace noise motivation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwgk committed Mar 1, 2025
1 parent 85cc92d commit b73f430
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/advanced/smart_ptrs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ simply add ``py::smart_holder`` to ``py::class_``:

.. note::

A shorthand, ``py::classh<T>``, is provided for ``py::class_<T,
py::smart_holder>``. The ``h`` in ``py::classh`` comes from
**smart_holder** but is condensed for brevity; it is the same number of
characters as ``py::class_``.
A shorthand, ``py::classh<T>``, is provided for
``py::class_<T, py::smart_holder>``. The ``h`` in ``py::classh`` stands
for **smart_holder** but is shortened for brevity, ensuring it has the
same number of characters as ``py::class_``. This design choice facilitates
easy experimentation with ``py::smart_holder`` without introducing
distracting whitespace noise in diffs.

The ``py::smart_holder`` functionality includes the following:

Expand Down

0 comments on commit b73f430

Please sign in to comment.