-
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
Add type_caster<PyObject>
#4601
Commits on Apr 1, 2023
-
Add
type_caster<PyObject>
(tests are still incomplete).Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for ef13f04 - Browse repository at this point
Copy the full SHA ef13f04View commit details -
Fix oversight (
const PyObject *
).Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for c7c52b0 - Browse repository at this point
Copy the full SHA c7c52b0View commit details -
Ensure
type_caster<PyObject>
only works forPyObject *
Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for f220f0c - Browse repository at this point
Copy the full SHA f220f0cView commit details -
Move
is_same_ignoring_cvref
intodetail
namespace.Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 467b237 - Browse repository at this point
Copy the full SHA 467b237View commit details -
Ralf W. Grosse-Kunstleve committed
Apr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 79f2b05 - Browse repository at this point
Copy the full SHA 79f2b05View commit details -
Change is_same_ignoring_cvref from variable template to using.
``` test_type_caster_pyobject_ptr.cpp:8:23: error: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’ [-Werror] 8 | static constexpr bool is_same_ignoring_cvref = std::is_same<detail::remove_cvref_t<T>, U>::value; | ^~~~~~~~~~~~~~~~~~~~~~ ```
Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 45f915b - Browse repository at this point
Copy the full SHA 45f915bView commit details -
Remove
return_value_policy::reference_internal
keep_alive
feature…… (because of doubts about it actually being useful).
Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 00cc8b4 - Browse repository at this point
Copy the full SHA 00cc8b4View commit details -
Add missing test, fix bug (missing
throw error_already_set();
), var……ious cosmetic changes.
Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 432de63 - Browse repository at this point
Copy the full SHA 432de63View commit details -
Move
type_caster<PyObject>
from test to new include (pybind11/type_……caster_pyobject_ptr.h)
Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for db47541 - Browse repository at this point
Copy the full SHA db47541View commit details -
Add new header file to CMakeLists.txt and tests/extra_python_package/…
…test_files.py
Ralf W. Grosse-Kunstleve committedApr 1, 2023 Configuration menu - View commit details
-
Copy full SHA for b393001 - Browse repository at this point
Copy the full SHA b393001View commit details
Commits on Apr 3, 2023
-
Backport changes from google/pybind11clif#30021 to pybind#4601
Ralf W. Grosse-Kunstleve committedApr 3, 2023 Configuration menu - View commit details
-
Copy full SHA for 0ba8003 - Browse repository at this point
Copy the full SHA 0ba8003View commit details
Commits on Apr 4, 2023
-
Merge branch 'master' into type_caster_PyObject_master
Ralf W. Grosse-Kunstleve committedApr 4, 2023 Configuration menu - View commit details
-
Copy full SHA for d976e66 - Browse repository at this point
Copy the full SHA d976e66View commit details -
Fix oversight in test (to resolve a valgrind leak detection error) an…
…d add a related comment in cast.h. No production code changes. Make tests more sensitive by using `ValueHolder` instead of empty tuples and dicts. Manual leak checks with `while True:` & top command repeated for all tests.
Ralf W. Grosse-Kunstleve committedApr 4, 2023 Configuration menu - View commit details
-
Copy full SHA for af1886a - Browse repository at this point
Copy the full SHA af1886aView commit details
Commits on Apr 5, 2023
-
Add tests for interop with stl.h
list_caster
(No production code changes.)
Ralf W. Grosse-Kunstleve committedApr 5, 2023 Configuration menu - View commit details
-
Copy full SHA for 3391bbd - Browse repository at this point
Copy the full SHA 3391bbdView commit details -
Bug fix in test. Minor comment enhancements.
Ralf W. Grosse-Kunstleve committedApr 5, 2023 Configuration menu - View commit details
-
Copy full SHA for f6c7cee - Browse repository at this point
Copy the full SHA f6c7ceeView commit details
Commits on Apr 27, 2023
-
Merge branch 'master' into type_caster_PyObject_master
Ralf W. Grosse-Kunstleve committedApr 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 9907943 - Browse repository at this point
Copy the full SHA 9907943View commit details -
Change
type_caster<PyObject>::name
toobject
, as suggested by @Sk…Ralf W. Grosse-Kunstleve committedApr 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 5ccb893 - Browse repository at this point
Copy the full SHA 5ccb893View commit details -
Merge branch 'master' into type_caster_PyObject_master
Ralf W. Grosse-Kunstleve committedApr 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 39cb0d8 - Browse repository at this point
Copy the full SHA 39cb0d8View commit details -
Expand comment for the new
T cast(const handle &handle)
[T
= `PyO……bject *`]
Ralf W. Grosse-Kunstleve committedApr 27, 2023 Configuration menu - View commit details
-
Copy full SHA for cf4c282 - Browse repository at this point
Copy the full SHA cf4c282View commit details
Commits on May 1, 2023
-
Merge branch 'master' into type_caster_PyObject_master
Ralf W. Grosse-Kunstleve committedMay 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 6afa757 - Browse repository at this point
Copy the full SHA 6afa757View commit details
Commits on May 2, 2023
-
Add
T cast(object &&obj)
overload as suggested by @Skylion007The original suggestion leads to `error: call to 'cast' is ambiguous` (full error message below), therefore SFINAE guarding is needed. ``` clang++ -o pybind11/tests/test_type_caster_pyobject_ptr.os -c -std=c++17 -fPIC -fvisibility=hidden -O0 -g -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -Wundef -Wnon-virtual-dtor -Wunused-result -Werror -isystem /usr/include/python3.10 -isystem /usr/include/eigen3 -DPYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX -DPYBIND11_ENABLE_TYPE_CASTER_ODR_GUARD_IF_AVAILABLE -DPYBIND11_TEST_BOOST -Ipybind11/include -I/usr/local/google/home/rwgk/forked/pybind11/include -I/usr/local/google/home/rwgk/clone/pybind11/include /usr/local/google/home/rwgk/forked/pybind11/tests/test_type_caster_pyobject_ptr.cpp In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/test_type_caster_pyobject_ptr.cpp:1: In file included from /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/functional.h:12: In file included from /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/pybind11.h:13: In file included from /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/detail/class.h:12: In file included from /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/attr.h:14: /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/cast.h:1165:12: error: call to 'cast' is ambiguous return pybind11::cast<T>(std::move(*this)); ^~~~~~~~~~~~~~~~~ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/functional.h:109:70: note: in instantiation of function template specialization 'pybind11::object::cast<_object *>' requested here return hfunc.f(std::forward<Args>(args)...).template cast<Return>(); ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/functional.h:103:16: note: in instantiation of member function 'pybind11::detail::type_caster<std::function<_object *(int)>>::load(pybind11::handle, bool)::func_wrapper::operator()' requested here struct func_wrapper { ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/cast.h:1456:47: note: in instantiation of member function 'pybind11::detail::type_caster<std::function<_object *(int)>>::load' requested here if ((... || !std::get<Is>(argcasters).load(call.args[Is], call.args_convert[Is]))) { ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/cast.h:1434:50: note: in instantiation of function template specialization 'pybind11::detail::argument_loader<const std::function<_object *(int)> &, int>::load_impl_sequence<0UL, 1UL>' requested here bool load_args(function_call &call) { return load_impl_sequence(call, indices{}); } ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/pybind11.h:227:33: note: in instantiation of member function 'pybind11::detail::argument_loader<const std::function<_object *(int)> &, int>::load_args' requested here if (!args_converter.load_args(call)) { ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/pybind11.h:101:9: note: in instantiation of function template specialization 'pybind11::cpp_function::initialize<(lambda at /usr/local/google/home/rwgk/forked/pybind11/tests/test_type_caster_pyobject_ptr.cpp:50:9), _object *, const std::function<_object *(int)> &, int, pybind11::name, pybind11::scope, pybind11::sibling, pybind11::return_value_policy>' requested here initialize( ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/pybind11.h:1163:22: note: in instantiation of function template specialization 'pybind11::cpp_function::cpp_function<(lambda at /usr/local/google/home/rwgk/forked/pybind11/tests/test_type_caster_pyobject_ptr.cpp:50:9), pybind11::name, pybind11::scope, pybind11::sibling, pybind11::return_value_policy, void>' requested here cpp_function func(std::forward<Func>(f), ^ /usr/local/google/home/rwgk/forked/pybind11/tests/test_type_caster_pyobject_ptr.cpp:48:7: note: in instantiation of function template specialization 'pybind11::module_::def<(lambda at /usr/local/google/home/rwgk/forked/pybind11/tests/test_type_caster_pyobject_ptr.cpp:50:9), pybind11::return_value_policy>' requested here m.def( ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/cast.h:1077:3: note: candidate function [with T = _object *, $1 = 0] T cast(object &&obj) { ^ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/cast.h:1149:1: note: candidate function [with T = _object *] cast(object &&object) { ^ 1 error generated. ```
Ralf W. Grosse-Kunstleve committedMay 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 2e5a699 - Browse repository at this point
Copy the full SHA 2e5a699View commit details