pybind11
2.0
About this project
Changelog
The Basics
First steps
Object-oriented code
Build systems
Advanced Topics
Functions
Classes
Exceptions
Smart pointers
Type conversions
Python C++ interface
Miscellaneous
Extra Information
Frequently asked questions
Benchmark
Limitations
Reference
pybind11
Docs
»
pybind11 — Seamless operability between C++11 and Python
View page source
pybind11 — Seamless operability between C++11 and Python
¶
About this project
Changelog
The Basics
First steps
Compiling the test cases
Header and namespace conventions
Creating bindings for a simple function
Keyword arguments
Default arguments
Exporting variables
Supported data types
Object-oriented code
Creating bindings for a custom type
Keyword and default arguments
Binding lambda functions
Instance and static fields
Dynamic attributes
Inheritance
Overloaded methods
Enumerations and internal types
Build systems
Building with setuptools
Building with cppimport
Building with CMake
Generating binding code automatically
Advanced Topics
Functions
Return value policies
Additional call policies
Python objects as arguments
Accepting *args and **kwargs
Default arguments revisited
Classes
Overriding virtual functions in Python
Combining virtual functions and inheritance
Extended trampoline class functionality
Custom constructors
Non-public destructors
Implicit conversions
Static properties
Operator overloading
Pickling support
Multiple Inheritance
Exceptions
Built-in exception translation
Registering custom translators
Smart pointers
std::unique_ptr
std::shared_ptr
Custom smart pointers
Type conversions
Overview
STL containers
Functional
Chrono
Eigen
Custom type casters
Python C++ interface
Python types
NumPy
Utilities
Miscellaneous
General notes regarding convenience macros
Global Interpreter Lock (GIL)
Binding sequence data types, iterators, the slicing protocol, etc.
Partitioning code over multiple extension modules
Generating documentation using Sphinx
Extra Information
Frequently asked questions
Benchmark
Limitations
Reference