pybind11/include/pybind11
Ralf W. Grosse-Kunstleve 0d44d720cb
Make stl.h list|set|map_caster more user friendly. (#4686)
* Add `test_pass_std_vector_int()`, `test_pass_std_set_int()` in test_stl

* Change `list_caster` to also accept generator objects (`PyGen_Check(src.ptr()`).

Note for completeness: This is a more conservative change than https://github.com/google/pywrapcc/pull/30042

* Drop in (currently unpublished) PyCLIF code, use in `list_caster`, adjust tests.

* Use `PyObjectTypeIsConvertibleToStdSet()` in `set_caster`, adjust tests.

* Use `PyObjectTypeIsConvertibleToStdMap()` in `map_caster`, add tests.

* Simplify `list_caster` `load()` implementation, push str/bytes check into `PyObjectTypeIsConvertibleToStdVector()`.

* clang-tidy cleanup with a few extra `(... != 0)` to be more consistent.

* Also use `PyObjectTypeIsConvertibleToStdVector()` in `array_caster`.

* Update comment pointing to clif/python/runtime.cc (code is unchanged).

* Comprehensive test coverage, enhanced set_caster load implementation.

* Resolve clang-tidy eror.

* Add a long C++ comment explaining what led to the `PyObjectTypeIsConvertibleTo*()` implementations.

* Minor function name change in test.

* strcmp -> std::strcmp (thanks @Skylion007 for catching this)

* Add `PyCallable_Check(items)` in `PyObjectTypeIsConvertibleToStdMap()`

* Resolve clang-tidy error

* Use `PyMapping_Items()` instead of `src.attr("items")()`, to be internally consistent with `PyMapping_Check()`

* Update link to PyCLIF sources.

* Fix typo (thanks @wangxf123456 for catching this)

* Add `test_pass_std_vector_int()`, `test_pass_std_set_int()` in test_stl

* Change `list_caster` to also accept generator objects (`PyGen_Check(src.ptr()`).

Note for completeness: This is a more conservative change than https://github.com/google/pywrapcc/pull/30042

* Drop in (currently unpublished) PyCLIF code, use in `list_caster`, adjust tests.

* Use `PyObjectTypeIsConvertibleToStdSet()` in `set_caster`, adjust tests.

* Use `PyObjectTypeIsConvertibleToStdMap()` in `map_caster`, add tests.

* Simplify `list_caster` `load()` implementation, push str/bytes check into `PyObjectTypeIsConvertibleToStdVector()`.

* clang-tidy cleanup with a few extra `(... != 0)` to be more consistent.

* Also use `PyObjectTypeIsConvertibleToStdVector()` in `array_caster`.

* Update comment pointing to clif/python/runtime.cc (code is unchanged).

* Comprehensive test coverage, enhanced set_caster load implementation.

* Resolve clang-tidy eror.

* Add a long C++ comment explaining what led to the `PyObjectTypeIsConvertibleTo*()` implementations.

* Minor function name change in test.

* strcmp -> std::strcmp (thanks @Skylion007 for catching this)

* Add `PyCallable_Check(items)` in `PyObjectTypeIsConvertibleToStdMap()`

* Resolve clang-tidy error

* Use `PyMapping_Items()` instead of `src.attr("items")()`, to be internally consistent with `PyMapping_Check()`

* Update link to PyCLIF sources.

* Fix typo (thanks @wangxf123456 for catching this)

* Fix typo discovered by new version of codespell.
2024-08-13 11:42:51 -07:00
..
detail feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
eigen clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
stl clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
attr.h Elide to-python conversion of setter return values (#4621) 2023-05-08 10:13:54 -07:00
buffer_info.h chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
cast.h feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
chrono.h chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
common.h Add a dummy common.h header with a deprecation warning 2017-09-06 15:22:26 +02:00
complex.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
eigen.h First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
embed.h feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
eval.h feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
functional.h Add type_caster_std_function_specializations feature. (#4597) 2024-08-09 13:28:12 -07:00
gil_safe_call_once.h fix: make gil_safe_call_once thread-safe in free-threaded CPython (#5246) 2024-07-16 11:06:54 -07:00
gil.h feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
iostream.h chore: add err guard to capsule destructor and add a move to iostream (#3958) 2022-05-27 14:32:57 -04:00
numpy.h clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
operators.h Reproducer and fix for issue encountered in smart_holder update. (#4228) 2022-10-09 21:50:35 -07:00
options.h Add option for enable/disable enum members in docstring. (#2768) 2022-12-08 23:10:10 -08:00
pybind11.h fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
pytypes.h fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
stl_bind.h clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
stl.h Make stl.h list|set|map_caster more user friendly. (#4686) 2024-08-13 11:42:51 -07:00
type_caster_pyobject_ptr.h Add type_caster<PyObject> (#4601) 2023-05-07 10:15:53 -07:00
typing.h Fixed a compilation error with gcc 14 (#5208) 2024-06-28 07:12:32 -07:00