pyo3/pyo3-macros-backend
Adam Reichold bd7aed4b12 Add implementation of Iterator::size_hint for PyIterator
When the Python iterator backing `PyIterator` has a `__length_hint__` special
method, we can use this as a lower bound for Rust's `Iterator::size_hint` to
e.g. support pre-allocation of collections.

This is implemented using `PyObject_LengthHint` which is not available in the
stable ABI and hence so is `Iterator::size_hint`. This should be fine since this
is an optimization in any case and the stable ABI is expected to have slightly
worse performance overall.
2023-07-09 10:16:20 +02:00
..
src Add implementation of Iterator::size_hint for PyIterator 2023-07-09 10:16:20 +02:00
Cargo.toml release: 0.19.1 2023-07-03 16:18:24 +01:00
LICENSE macros: rename crates for consistency 2020-12-20 06:39:28 +00:00