Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
3e2e44f5
Commit
3e2e44f5
authored
Jul 18, 2016
by
Jason Rhinelander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated advanced.rst example references
parent
b3f3d79f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
36 deletions
+40
-36
docs/advanced.rst
+40
-36
No files found.
docs/advanced.rst
View file @
3e2e44f5
...
...
@@ -102,8 +102,9 @@ C++ side, or to perform other types of customization.
.. seealso::
The file :file:`example/example3.cpp` contains a complete example that
demonstrates how to work with overloaded operators in more detail.
The file :file:`example/example-operator-overloading.cpp` contains a
complete example that demonstrates how to work with overloaded operators in
more detail.
Callbacks and passing anonymous functions
=========================================
...
...
@@ -209,8 +210,9 @@ The following interactive session shows how to call them from Python.
This functionality is very useful when generating bindings for callbacks in
C++ libraries (e.g. GUI libraries, asynchronous networking libraries, etc.).
The file :file:`example/example5.cpp` contains a complete example that
demonstrates how to work with callbacks and anonymous functions in more detail.
The file :file:`example/example-callbacks.cpp` contains a complete example
that demonstrates how to work with callbacks and anonymous functions in
more detail.
Overriding virtual functions in Python
======================================
...
...
@@ -347,9 +349,9 @@ Please take a look at the :ref:`macro_notes` before using this feature.
.. seealso::
The file :file:`example/example
12.cpp` contains a complete example that
demonstrates how to override virtual functions using pybind11 in more
detail.
The file :file:`example/example
-virtual-functions.cpp` contains a complete
example that demonstrates how to override virtual functions using pybind11
in more
detail.
.. _macro_notes:
...
...
@@ -433,8 +435,8 @@ out of the box with just the core :file:`pybind11/pybind11.h` header.
.. seealso::
The file :file:`example/example
2.cpp` contains a complete example that
demonstrates how to pass STL data types in more detail.
The file :file:`example/example
-python-types.cpp` contains a complete
example that
demonstrates how to pass STL data types in more detail.
Binding sequence data types, iterators, the slicing protocol, etc.
==================================================================
...
...
@@ -443,10 +445,10 @@ Please refer to the supplemental example for details.
.. seealso::
The file :file:`example/example
6.cpp` contains a complete example that
shows how to bind a sequence data type, including length queries
(``__len__``), iterators (``__iter__``), the slicing protocol and other
kinds of useful operations.
The file :file:`example/example
-sequences-and-iterators.cpp` contains a
complete example that shows how to bind a sequence data type, including
length queries (``__len__``), iterators (``__iter__``), the slicing
protocol and other
kinds of useful operations.
Return value policies
=====================
...
...
@@ -630,8 +632,8 @@ might be declared as follows:
.. seealso::
The file :file:`example/example
13.cpp` contains a complete example that
demonstrates using :class:`keep_alive` in more detail.
The file :file:`example/example
-keep-alive.cpp` contains a complete example
that
demonstrates using :class:`keep_alive` in more detail.
Implicit type conversions
=========================
...
...
@@ -832,9 +834,9 @@ Please take a look at the :ref:`macro_notes` before using this feature.
.. seealso::
The file :file:`example/example
8.cpp` contains a complete example that
demonstrates how to work with custom reference-counting holder types in
more detail.
The file :file:`example/example
-smart-ptr.cpp` contains a complete example
that demonstrates how to work with custom reference-counting holder types
in
more detail.
.. _custom_constructors:
...
...
@@ -939,7 +941,7 @@ a first shot at handling the exception).
Inside the translator, ``std::rethrow_exception`` should be used within
a try block to re-throw the exception. A catch clause can then use
``PyErr_SetString`` to set a Python exception as demonstrated
in :file:`example
19
.cpp``.
in :file:`example
-custom-exceptions
.cpp``.
This example also demonstrates how to create custom exception types
with ``py::exception``.
...
...
@@ -1077,9 +1079,9 @@ Please take a look at the :ref:`macro_notes` before using this feature.
.. seealso::
The file :file:`example/example
14.cpp` contains a complete example that
demonstrates how to create and expose opaque types using pybind11 in more
detail.
The file :file:`example/example
-opaque-types.cpp` contains a complete
example that demonstrates how to create and expose opaque types using
pybind11 in more
detail.
.. _eigen:
...
...
@@ -1249,8 +1251,8 @@ limitations), refer to the section on :ref:`eigen`.
.. seealso::
The file :file:`example/example
7.cpp` contains a complete example that
demonstrates using the buffer protocol with pybind11 in more detail.
The file :file:`example/example
-buffers.cpp` contains a complete example
that
demonstrates using the buffer protocol with pybind11 in more detail.
.. [#f2] http://docs.python.org/3/c-api/buffer.html
...
...
@@ -1398,8 +1400,8 @@ simply using ``vectorize``).
.. seealso::
The file :file:`example/example
10.cpp` contains a complete example that
demonstrates using :func:`vectorize` in more detail.
The file :file:`example/example
-numpy-vectorize.cpp` contains a complete
example that
demonstrates using :func:`vectorize` in more detail.
Functions taking Python objects as arguments
============================================
...
...
@@ -1462,9 +1464,10 @@ with other parameters.
.. seealso::
The file :file:`example/example2.cpp` contains a complete example that
demonstrates passing native Python types in more detail. The file
:file:`example/example11.cpp` discusses usage of ``args`` and ``kwargs``.
The file :file:`example/example-python-types.cpp` contains a complete
example that demonstrates passing native Python types in more detail. The
file :file:`example/example-arg-keywords-and-defaults.cpp` discusses usage
of ``args`` and ``kwargs``.
Default arguments revisited
===========================
...
...
@@ -1537,11 +1540,11 @@ Such functions can also be created using pybind11:
/// Binding code
m.def("generic", &generic);
(See ``example/example
11.cpp``). The class ``py::args`` derives from
``py::list`` and ``py::kwargs`` derives from ``py::dict`` Note that th
e
``kwargs`` argument is invalid if no keyword arguments were actually provided.
Please refer to the other examples for details on how to iterate over these,
and on how to cast their entries into C++ objects.
(See ``example/example
-arg-keywords-and-defaults.cpp``). The class ``py::args``
derives from ``py::list`` and ``py::kwargs`` derives from ``py::dict`` Not
e
that the ``kwargs`` argument is invalid if no keyword arguments were actually
provided. Please refer to the other examples for details on how to iterate
over these,
and on how to cast their entries into C++ objects.
Partitioning code over multiple extension modules
=================================================
...
...
@@ -1682,8 +1685,9 @@ memory corruption and/or segmentation faults.
.. seealso::
The file :file:`example/example15.cpp` contains a complete example that
demonstrates how to pickle and unpickle types using pybind11 in more detail.
The file :file:`example/example-pickling.cpp` contains a complete example
that demonstrates how to pickle and unpickle types using pybind11 in more
detail.
.. [#f3] http://docs.python.org/3/library/pickle.html#pickling-class-instances
...
...
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