@@ -1166,7 +1166,8 @@ class module_ : public object {
11661166 already exists.
11671167
11681168 ``overwrite`` should almost always be false: attempting to overwrite objects that pybind11
1169- has established will, in most cases, break things. \endrst */
1169+ has established will, in most cases, break things.
1170+ \endrst */
11701171 PYBIND11_NOINLINE void add_object (const char *name, handle obj, bool overwrite = false ) {
11711172 if (!overwrite && hasattr (*this , name))
11721173 pybind11_fail (
@@ -2657,12 +2658,13 @@ PYBIND11_NAMESPACE_END(detail)
26572658
26582659/* * \rst
26592660 Try to retrieve a python method by the provided name from the instance pointed to by the
2660- this_ptr.
2661+ this_ptr.
26612662
26622663 :this_ptr: The pointer to the object the overridden method should be retrieved for. This should
2663- be the first non-trampoline class encountered in the inheritance chain. :name: The name of the
2664- overridden Python method to retrieve. :return: The Python method by this name from the object or
2665- an empty function wrapper. \endrst */
2664+ be the first non-trampoline class encountered in the inheritance chain.
2665+ :name: The name of the overridden Python method to retrieve.
2666+ :return: The Python method by this name from the object or an empty function wrapper.
2667+ \endrst */
26662668template <class T >
26672669function get_override (const T *this_ptr, const char *name) {
26682670 auto *tinfo = detail::get_type_info (typeid (T));
@@ -2686,10 +2688,10 @@ function get_override(const T *this_ptr, const char *name) {
26862688
26872689/* * \rst
26882690 Macro to populate the virtual method in the trampoline class. This macro tries to look up a
2689- method named 'fn' from the Python side, deals with the :ref:`gil` and necessary argument
2690- conversions to call this method and return the appropriate type. See :ref:`overriding_virtuals` for
2691- more information. This macro should be used when the method name in C is not the same as the method
2692- name in Python. For example with `__str__`.
2691+ method named 'fn' from the Python side, deals with the :ref:`gil` and necessary argument
2692+ conversions to call this method and return the appropriate type.
2693+ See :ref:`overriding_virtuals` for more information. This macro should be used when the method
2694+ name in C is not the same as the method name in Python. For example with `__str__`.
26932695
26942696 .. code-block:: cpp
26952697
@@ -2710,7 +2712,8 @@ name in Python. For example with `__str__`.
27102712
27112713/* * \rst
27122714 Macro for pure virtual functions, this function is identical to
2713- :c:macro:`PYBIND11_OVERRIDE_NAME`, except that it throws if no override can be found. \endrst */
2715+ :c:macro:`PYBIND11_OVERRIDE_NAME`, except that it throws if no override can be found.
2716+ \endrst */
27142717#define PYBIND11_OVERRIDE_PURE_NAME (ret_type, cname, name, fn, ...) \
27152718 do { \
27162719 PYBIND11_OVERRIDE_IMPL (PYBIND11_TYPE (ret_type), PYBIND11_TYPE (cname), name, __VA_ARGS__); \
@@ -2720,9 +2723,9 @@ name in Python. For example with `__str__`.
27202723
27212724/* * \rst
27222725 Macro to populate the virtual method in the trampoline class. This macro tries to look up the
2723- method from the Python side, deals with the :ref:`gil` and necessary argument conversions to call
2724- this method and return the appropriate type. This macro should be used if the method name in C and
2725- in Python are identical. See :ref:`overriding_virtuals` for more information.
2726+ method from the Python side, deals with the :ref:`gil` and necessary argument conversions to
2727+ call this method and return the appropriate type. This macro should be used if the method name
2728+ in C and in Python are identical. See :ref:`overriding_virtuals` for more information.
27262729
27272730 .. code-block:: cpp
27282731
@@ -2747,7 +2750,8 @@ in Python are identical. See :ref:`overriding_virtuals` for more information.
27472750
27482751/* * \rst
27492752 Macro for pure virtual functions, this function is identical to :c:macro:`PYBIND11_OVERRIDE`,
2750- except that it throws if no override can be found. \endrst */
2753+ except that it throws if no override can be found.
2754+ \endrst */
27512755#define PYBIND11_OVERRIDE_PURE (ret_type, cname, fn, ...) \
27522756 PYBIND11_OVERRIDE_PURE_NAME ( \
27532757 PYBIND11_TYPE (ret_type), PYBIND11_TYPE (cname), #fn, fn, __VA_ARGS__)
0 commit comments