pybind11
pybind11 copied to clipboard
Seamless operability between C++11 and Python
### Required prerequisites - [X] Make sure you've read the [documentation](https://pybind11.readthedocs.io). Your issue may be addressed there. - [X] Search the [issue tracker](https://github.com/pybind/pybind11/issues) and [Discussions](https:/pybind/pybind11/discussions) to verify that this hasn't...
## Description According to the buffer protocol, `ndim` is a _required_ field [1], and should always be set correctly. Additionally, `shape` should be set if flags includes `PyBUF_ND` or higher...
## Description I found a mistake in the documentation for custom [type_casters](https://github.com/pybind/pybind11/blob/f7e14e985be167ca158fd3ee2fe5d8a4f175fa87/docs/advanced/cast/custom.rst), which I believe hasn't been covered by an open issue or PR yet. The `load` function of a...
### Required prerequisites - [X] Make sure you've read the [documentation](https://pybind11.readthedocs.io). Your issue may be addressed there. - [X] Search the [issue tracker](https://github.com/pybind/pybind11/issues) and [Discussions](https:/pybind/pybind11/discussions) to verify that this hasn't...
### Required prerequisites - [X] Make sure you've read the [documentation](https://pybind11.readthedocs.io). Your issue may be addressed there. - [X] Search the [issue tracker](https://github.com/pybind/pybind11/issues) and [Discussions](https:/pybind/pybind11/discussions) to verify that this hasn't...
## Description This PR allows to annotate methods such as `__repr__(self)` to be positional-only. For example: ```cpp py::class_(mod, "MyClass") .def("__repr__", &MyClass::ToString, py::pos_only()); .def("my_method_no_args", &MyClass::MyMethodNoArgs, py::pos_only()); ``` will generate annotation: ```python...
[BUG]: Pure virtual method overriding using mixin class gives: Tried to call pure virtual function …
### Required prerequisites - [X] Make sure you've read the [documentation](https://pybind11.readthedocs.io). Your issue may be addressed there. - [X] Search the [issue tracker](https://github.com/pybind/pybind11/issues) and [Discussions](https:/pybind/pybind11/discussions) to verify that this hasn't...
## Description **Scratch PR for experimenting.** ## Suggested changelog entry: ```rst ```
## Description See discussion under #5396. **Completing this (see TODOs) is a nice project for someone who wants to build their skills working with and on pybind11.** If you're interested,...
The recommended method of creating a subclass from https://github.com/pybind/pybind11/issues/1193#issuecomment-429451094 does not seem to allow for passing keyword arguments. This test fails with: ``` def test_kw_only(): > assert (m.KwOnlyMethod().test("x", y="y") ==...