pyo3
pyo3 copied to clipboard
LinkedList<T> to PyList conversion
Resolves #2405
Has been mentioned on Discord that converting a LinkedList<T> to a PyList could be surprising for users.
What would the alternative be? As a data point pybind11
converts std::list
to Python lists. https://github.com/pybind/pybind11/blob/0e956a2e4f7838fc26f42a6399bc358ae7248134/include/pybind11/stl.h#L200
CI failure is because impl<T, const N: usize> From<[T; N]> for LinkedList<T>
is only available for Rust 1.56+. vec![1,2.3].into_iter().collect()
is a decent way to make one for a test, I think.
What would the alternative be? As a data point
pybind11
convertsstd::list
to Python lists. https://github.com/pybind/pybind11/blob/0e956a2e4f7838fc26f42a6399bc358ae7248134/include/pybind11/stl.h#L200
I mean, they're very different data structures. I'm not convinced that linkedlist -> pylist is the obvious thing to do.