mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-28 16:11:59 +00:00
Fix code formatting
This commit is contained in:
parent
7266988540
commit
2fbd013434
@ -333,9 +333,9 @@ Handling warnings from the Python C API
|
|||||||
|
|
||||||
Where possible, use :ref:`pybind11 warnings <warnings>` instead of calling
|
Where possible, use :ref:`pybind11 warnings <warnings>` instead of calling
|
||||||
the Python C API directly. The motivation is similar to previously mentioned errors.
|
the Python C API directly. The motivation is similar to previously mentioned errors.
|
||||||
All warnings categories are required to be a subclass of `PyExc_Warning` from Python C API.
|
All warnings categories are required to be a subclass of ``PyExc_Warning`` from Python C API.
|
||||||
|
|
||||||
Warnings can be raised with `warn` function:
|
Warnings can be raised with ``warn`` function:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ Warnings can be raised with `warn` function:
|
|||||||
// When calling `stack_level` can be specified as well.
|
// When calling `stack_level` can be specified as well.
|
||||||
py::warnings::warn("Another one!", PyExc_DeprecationWarning, 3);
|
py::warnings::warn("Another one!", PyExc_DeprecationWarning, 3);
|
||||||
|
|
||||||
New warning types can be registered on the module level with `new_warning_type`:
|
New warning types can be registered on the module level with ``new_warning_type``:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user