How to return Vec<PyAny> from python list? #2684
-
My python function needs to return a list of objects, each of which cannot be easily converted to rust objects. This script does the conversion. It's done in the function with signature:
ie the function converts PyAny into the object I need which is polars::Series. My python function however has to return a list of such objects (a list of python Series):
My question is, since the returned object is python list, I want something like:
What is the right way to do it? ie How do I turn the returned value into Vec (or anything which implements iter) so that I can use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Try let r: Vec<Py<PyAny>> = app.call0(py)?.extract(py)?; |
Beta Was this translation helpful? Give feedback.
Try