Commit 8d862b37 by Wenzel Jakob

documentation updates (clarified cross-module dependencies, added contributors, improved CSS)

parent bce8a4b9
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
[![Documentation Status](https://readthedocs.org/projects/pybind11/badge/?version=latest)](http://pybind11.readthedocs.org/en/latest/?badge=latest) [![Documentation Status](https://readthedocs.org/projects/pybind11/badge/?version=latest)](http://pybind11.readthedocs.org/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/pybind/pybind11.svg?branch=master)](https://travis-ci.org/pybind/pybind11) [![Build Status](https://travis-ci.org/pybind/pybind11.svg?branch=master)](https://travis-ci.org/pybind/pybind11)
[![Build status](https://ci.appveyor.com/api/projects/status/riaj54pn4h08xy40?svg=true)](https://ci.appveyor.com/project/pybind/pybind11) [![Build status](https://ci.appveyor.com/api/projects/status/riaj54pn4h08xy40?svg=true)](https://ci.appveyor.com/project/wjakob/pybind11)
**pybind11** is a lightweight header-only library that exposes C++ types in Python **pybind11** is a lightweight header-only library that exposes C++ types in Python
and vice versa, mainly to create Python bindings of existing C++ code. Its and vice versa, mainly to create Python bindings of existing C++ code. Its
...@@ -92,8 +92,9 @@ Significant features and/or improvements to the code were contributed by ...@@ -92,8 +92,9 @@ Significant features and/or improvements to the code were contributed by
Jonas Adler, Jonas Adler,
Sylvain Corlay, Sylvain Corlay,
Axel Huebl, Axel Huebl,
Johan Mabille, and Johan Mabille,
Tomasz Miąsko. Tomasz Miąsko, and
Ben Pritchard.
### License ### License
......
.wy-table-responsive table td, .wy-table-responsive table td,
.wy-table-responsive table th { .wy-table-responsive table th {
white-space: initial; white-space: initial !important;
} }
.rst-content table.docutils td { .rst-content table.docutils td {
vertical-align: top; vertical-align: top !important;
} }
...@@ -1019,8 +1019,8 @@ like so: ...@@ -1019,8 +1019,8 @@ like so:
Partitioning code over multiple extension modules Partitioning code over multiple extension modules
================================================= =================================================
It's straightforward to split binding code over multiple extension modules and It's straightforward to split binding code over multiple extension modules, while
reference types declared elsewhere. Everything "just" works without any special referencing types that are declared elsewhere. Everything "just" works without any special
precautions. One exception to this rule occurs when wanting to extend a type declared precautions. One exception to this rule occurs when wanting to extend a type declared
in another extension module. Recall the basic example from Section in another extension module. Recall the basic example from Section
:ref:`inheritance`. :ref:`inheritance`.
...@@ -1049,3 +1049,17 @@ However, it can be acquired as follows: ...@@ -1049,3 +1049,17 @@ However, it can be acquired as follows:
.def(py::init<const std::string &>()) .def(py::init<const std::string &>())
.def("bark", &Dog::bark); .def("bark", &Dog::bark);
Alternatively, we can rely on the ``base`` tag, which performs an automated
lookup of the corresponding Python type. However, this also requires invoking
the ``import`` function once to ensure that the pybind11 binding code of the
module ``basic`` has been executed.
Naturally, both methods will fail when there are cyclic dependencies.
.. code-block:: cpp
py::module::import("basic");
py::class_<Dog>(m, "Dog", py::base<Pet>())
.def(py::init<const std::string &>())
.def("bark", &Dog::bark);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment