Skip to content

Commit b5b5f43

Browse files
committed
docs: include change in docs
1 parent d09bfa1 commit b5b5f43

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/advanced/cast/custom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type is explicitly allowed.
4646
* function signatures and declares a local variable
4747
* 'value' of type inty
4848
*/
49-
PYBIND11_TYPE_CASTER(inty, _("inty"));
49+
PYBIND11_TYPE_CASTER(inty, const_str("inty"));
5050
5151
/**
5252
* Conversion part 1 (Python->C++): convert a PyObject into a inty

docs/upgrade.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ v2.9
1717
converted to using ``py::module_::import("types").attr("SimpleNamespace")``
1818
instead.
1919

20+
* The use of ``_`` in custom type casters can now be replaced with the more
21+
readable ``const_str`` instead. The old ``_`` shortcut has been retained
22+
unless it is being used as a macro (like for gettext).
23+
2024

2125
.. _upgrade-guide-2.7:
2226

0 commit comments

Comments
 (0)