Skip to content

Commit a4f6627

Browse files
DWeslpre-commit-ci[bot]
authored andcommitted
docs: clarify requirements for including pybind11 (#5326)
* DOC: Clarify requirements for including pybind11 Inherited from requirements for including Python.h Closes #4999 * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0d21cad commit a4f6627

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/basics.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ For brevity, all code examples assume that the following two lines are present:
7878
7979
namespace py = pybind11;
8080
81+
.. note::
82+
83+
``pybind11/pybind11.h`` includes ``Python.h``, as such it must be the first file
84+
included in any source file or header for `the same reasons as Python.h`_.
85+
86+
.. _`the same reasons as Python.h`: https://docs.python.org/3/extending/extending.html#a-simple-example
87+
8188
Some features may require additional headers, but those will be specified as needed.
8289

8390
.. _simple_example:

0 commit comments

Comments
 (0)