-
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
fix: <ranges>
support for py::tuple
and py::list
#5314
Conversation
There's two tiny questions:
|
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.
pypy has so many problems and flakes so often, I wouldn't want to add another (flaky) job. |
No. We have so much test coverage across other compilers, we don't need to get that one. |
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.
Looks nice, but caveat: I'm not familiar with <ranges>
, std::random_access_iterator
, std::ranges::views::transform
.
I'll merge this after you condense the code around PYBIND11_TEST_PYTYPES_HAS_RANGES
.
<ranges>
support for py::tuple
and py::list
<ranges>
support for py::tuple
and py::list
* feat: add `<ranges>` support for `py::tuple` and `py::list` * fix: format the code * fix: disable `ranges` in clang < 16 * refactor: move `<ranges>` test macro to `test_pytypes.h` * refactor: seperate `ranges` test into 3 funcs * style: compress the if statement * style: pre-commit fixes * style: better formatting --------- Co-authored-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
It seems that #4127 has made a mistake there: actually p2325r3 says nothing about C++ sentinels (which always requires
semiregular
), so it's necessary to add a default constructor foriterator_policies
classes.Moreover,
forward_iterator
concept requires that:and it's tested here:
https://github.com/ObeliskGate/pybind11/blob/74615a04105366647261da83f2980cd5df01b3cd/tests/test_pytypes.cpp#L932-L940
, together with other simple tests.
Suggested changelog entry: