PyO3 PyList to Rust Vec<T>

I am creating a mini-library for python written on Rust and I have a function that takes PyList as parameter, but inside a function I have to use a function which takes a usual rust slice and use this PyList as a parameter.
What should I do to convert PyList to the Rust Vector/slice? I tried to pass Vector as a parameter, but I got an error.

Use PyAny::extract().

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.