-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[smart_holder] Enable properties for non-owning holders #4586
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failing: ``` __________________________________________________________ test_persistent_holder __________________________________________________________ def test_persistent_holder(): h = m.DataFieldsHolder(2) > c = h.vec_at(0).core_fld E RuntimeError: Non-owning holder (loaded_as_shared_ptr). h = <pybind11_tests.class_sh_property_non_owning.DataFieldsHolder object at 0x7fabab516470> test_class_sh_property_non_owning.py:6: RuntimeError __________________________________________________________ test_temporary_holder ___________________________________________________________ def test_temporary_holder(): d = m.DataFieldsHolder(2).vec_at(1) > c = d.core_fld E RuntimeError: Non-owning holder (loaded_as_shared_ptr). d = <pybind11_tests.class_sh_property_non_owning.DataField object at 0x7fabab548770> test_class_sh_property_non_owning.py:13: RuntimeError ```
… `property_cpp_function`s with `const shared_ptr<T> &` arguments. Tests are incomplete.
wangxf123456
approved these changes
Mar 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me.
rwgk
pushed a commit
to rwgk/pybind11
that referenced
this pull request
Mar 24, 2023
rwgk
pushed a commit
that referenced
this pull request
Mar 24, 2023
* use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) * Apply descr.h `src_loc` change (smart_holder PR #4022) to code added with master PR #4587 * Add test_class_sh_property_non_owning to CMakeLists.txt (fixes oversight in PR #4586) * Resolve clang-tidy errors. * clang-tidy auto fix --------- Co-authored-by: Konstantin Bespalov <kos5tya@yandex.ru>
rwgk
pushed a commit
to rwgk/pybind11clif
that referenced
this pull request
Mar 24, 2023
…ranch). The behavior change made it possible to exercise the `reference_internal` vs `copy` behavior more thoroughly, which then led to a surprise discovery. See SURPRISE comment in tests/test_class_sh_property_stl.py
rwgk
pushed a commit
to rwgk/pybind11clif
that referenced
this pull request
Mar 24, 2023
…ranch). The behavior change made it possible to exercise the `reference_internal` vs `copy` behavior more thoroughly, which then led to a surprise discovery. See SURPRISE comment in tests/test_class_sh_property_stl.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The new test is a reduced use case found in the wild.
This supports the PyCLIF-pybind11 integration.
Suggested changelog entry: