mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Fixes based on newly added pre-submit checks.
This commit is contained in:
parent
97868321a3
commit
cce23af383
@ -112,10 +112,10 @@ There are three small differences compared to Classic pybind11:
|
|||||||
|
|
||||||
To the 2nd bullet point, the ``PYBIND11_SMART_HOLDER_TYPE_CASTERS`` macro
|
To the 2nd bullet point, the ``PYBIND11_SMART_HOLDER_TYPE_CASTERS`` macro
|
||||||
needs to appear in all translation units with pybind11 bindings that involve
|
needs to appear in all translation units with pybind11 bindings that involve
|
||||||
Python⇄C++ conversions for `Foo`. This is the biggest inconvenience of the
|
Python⇄C++ conversions for ``Foo``. This is the biggest inconvenience of the
|
||||||
Conservative mode. Practically, at a larger scale it is best to work with a
|
Conservative mode. Practically, at a larger scale it is best to work with a
|
||||||
pair of `.h` and `.cpp` files for the bindings code, with the macros in the
|
pair of ``.h`` and ``.cpp`` files for the bindings code, with the macros in
|
||||||
`.h` files.
|
the ``.h`` files.
|
||||||
|
|
||||||
To the 3rd bullet point, ``py::classh<Foo>`` is simply a shortcut for
|
To the 3rd bullet point, ``py::classh<Foo>`` is simply a shortcut for
|
||||||
``py::class_<Foo, py::smart_holder>``. The shortcut makes it possible to
|
``py::class_<Foo, py::smart_holder>``. The shortcut makes it possible to
|
||||||
@ -155,7 +155,7 @@ To work in Progressive mode:
|
|||||||
- Remove or replace (see below) ``std::shared_ptr<...>`` holders.
|
- Remove or replace (see below) ``std::shared_ptr<...>`` holders.
|
||||||
|
|
||||||
- Only if custom smart-pointers are used: the
|
- Only if custom smart-pointers are used: the
|
||||||
`PYBIND11_TYPE_CASTER_BASE_HOLDER` macro is needed (see
|
``PYBIND11_TYPE_CASTER_BASE_HOLDER`` macro is needed (see
|
||||||
tests/test_smart_ptr.cpp for examples).
|
tests/test_smart_ptr.cpp for examples).
|
||||||
|
|
||||||
Overall this is probably easier to work with than the Conservative mode, but
|
Overall this is probably easier to work with than the Conservative mode, but
|
||||||
|
@ -3,7 +3,7 @@ import weakref
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import env # noqa: F401
|
import env
|
||||||
import pybind11_tests.class_sh_trampoline_shared_from_this as m
|
import pybind11_tests.class_sh_trampoline_shared_from_this as m
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user