pybind11 — Seamless operability between C++11 and Python¶
- About this project
- First steps
- Object-oriented code
- Advanced topics
- Exporting constants and mutable objects
- Operator overloading
- Callbacks and passing anonymous functions
- Overriding virtual functions in Python
- General notes regarding convenience macros
- Global Interpreter Lock (GIL)
- Passing STL data structures
- Binding sequence data types, iterators, the slicing protocol, etc.
- Return value policies
- Additional call policies
- Implicit type conversions
- Unique pointers
- Smart pointers
- Custom constructors
- Catching and throwing exceptions
- Treating STL data structures as opaque objects
- Transparent conversion of dense and sparse Eigen data types
- Buffer protocol
- NumPy support
- Vectorizing functions
- Functions taking Python objects as arguments
- Default arguments revisited
- Binding functions that accept arbitrary numbers of arguments and keywords arguments
- Partitioning code over multiple extension modules
- Pickling support
- Generating documentation using Sphinx
- Build systems
- Benchmark
- Limitations
- Frequently asked questions
- “ImportError: dynamic module does not define init function”
- “Symbol not found:
__Py_ZeroStruct
/_PyInstanceMethod_Type
” - The Python interpreter immediately crashes when importing my module
- CMake doesn’t detect the right Python version
- Limitations involving reference arguments
- How can I reduce the build time?
- How can I create smaller binaries?
- Working with ancient Visual Studio 2009 builds on Windows
- Reference
- Changelog