pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.18k stars 2.06k forks source link

feat: Support move-only iterators in `py::make_*iterator` #4834

Closed sizmailov closed 10 months ago

sizmailov commented 10 months ago

Description

Support heavy (move-only) iterators in py::make_iterator, py::make_key_iterator, py::make_value_iterator

Suggested changelog entry:

Support move-only iterators in ``py::make_iterator``, ``py::make_key_iterator``, ``py::make_value_iterator``
rwgk commented 10 months ago

Note: the added test covers only py::make_iterator but not py::make_key_iterator, py::make_value_iterator

Wow, the new test case really is very cumbersome. Is that why you didn't cover the other two? I know I may be asking a lot, but could you try anyway?

Could it make sense in this particular case to simply modify some existing key and value iterator tests?

sizmailov commented 10 months ago

@rwgk Thanks for the hint! I like it much better now.