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>
This commit is contained in:
DWesl 2024-08-22 00:29:21 -04:00 committed by GitHub
parent 9966ad409d
commit efa2b20d69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -78,6 +78,13 @@ For brevity, all code examples assume that the following two lines are present:
namespace py = pybind11; namespace py = pybind11;
.. note::
``pybind11/pybind11.h`` includes ``Python.h``, as such it must be the first file
included in any source file or header for `the same reasons as Python.h`_.
.. _`the same reasons as Python.h`: https://docs.python.org/3/extending/extending.html#a-simple-example
Some features may require additional headers, but those will be specified as needed. Some features may require additional headers, but those will be specified as needed.
.. _simple_example: .. _simple_example: