Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
8d862b37
Commit
8d862b37
authored
Mar 06, 2016
by
Wenzel Jakob
Browse files
documentation updates (clarified cross-module dependencies, added contributors, improved CSS)
parent
bce8a4b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
README.md
README.md
+4
-3
docs/_static/theme_overrides.css
docs/_static/theme_overrides.css
+2
-2
docs/advanced.rst
docs/advanced.rst
+16
-2
No files found.
README.md
View file @
8d862b37
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
[

](http://pybind11.readthedocs.org/en/latest/?badge=latest)
[

](http://pybind11.readthedocs.org/en/latest/?badge=latest)
[

](https://travis-ci.org/pybind/pybind11)
[

](https://travis-ci.org/pybind/pybind11)
[

](https://ci.appveyor.com/project/
pybind
/pybind11)
[

](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
...
...
docs/_static/theme_overrides.css
View file @
8d862b37
.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
;
}
}
docs/advanced.rst
View file @
8d862b37
...
@@ -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
referenc
e
types declared elsewhere. Everything "just" works without any special
referenc
ing
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);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment