@@ -1166,7 +1166,8 @@ class module_ : public object {
1166
1166
already exists.
1167
1167
1168
1168
``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 */
1170
1171
PYBIND11_NOINLINE void add_object (const char *name, handle obj, bool overwrite = false ) {
1171
1172
if (!overwrite && hasattr (*this , name))
1172
1173
pybind11_fail (
@@ -2657,12 +2658,13 @@ PYBIND11_NAMESPACE_END(detail)
2657
2658
2658
2659
/* * \rst
2659
2660
Try to retrieve a python method by the provided name from the instance pointed to by the
2660
- this_ptr.
2661
+ this_ptr.
2661
2662
2662
2663
: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 */
2666
2668
template <class T >
2667
2669
function get_override (const T *this_ptr, const char *name) {
2668
2670
auto *tinfo = detail::get_type_info (typeid (T));
@@ -2686,10 +2688,10 @@ function get_override(const T *this_ptr, const char *name) {
2686
2688
2687
2689
/* * \rst
2688
2690
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__`.
2693
2695
2694
2696
.. code-block:: cpp
2695
2697
@@ -2710,7 +2712,8 @@ name in Python. For example with `__str__`.
2710
2712
2711
2713
/* * \rst
2712
2714
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 */
2714
2717
#define PYBIND11_OVERRIDE_PURE_NAME (ret_type, cname, name, fn, ...) \
2715
2718
do { \
2716
2719
PYBIND11_OVERRIDE_IMPL (PYBIND11_TYPE (ret_type), PYBIND11_TYPE (cname), name, __VA_ARGS__); \
@@ -2720,9 +2723,9 @@ name in Python. For example with `__str__`.
2720
2723
2721
2724
/* * \rst
2722
2725
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.
2726
2729
2727
2730
.. code-block:: cpp
2728
2731
@@ -2747,7 +2750,8 @@ in Python are identical. See :ref:`overriding_virtuals` for more information.
2747
2750
2748
2751
/* * \rst
2749
2752
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 */
2751
2755
#define PYBIND11_OVERRIDE_PURE (ret_type, cname, fn, ...) \
2752
2756
PYBIND11_OVERRIDE_PURE_NAME ( \
2753
2757
PYBIND11_TYPE (ret_type), PYBIND11_TYPE (cname), #fn, fn, __VA_ARGS__)
0 commit comments