Add test for mixing STL casters and local binders across modules #997
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to address one of the lingering questions from #919. Even if it doesn't directly answer that, it's still a useful test to add.
One module uses a generic vector caster from
<pybind11/stl.h>
while the other exportsstd::vector<int>
with a localpy:bind_vector
. The vector caster from<pybind11/stl.h>
accepts anything that looks like a sequence, so it will happily load thepy::module_local
opaque vector from a different module. Even if it can't see it's C++ type data, it still behaves like a sequence and can be converted generically.Note: Type aliases and
PYBIND11_MAKE_OPAQUE
needed to be added for several types because of the inclusion of<pybind11/stl.h>
.