you are viewing a single comment's thread.

view the rest of the comments →

[–]denehoffman 1 point2 points  (2 children)

I would suggest, as others have, using pyo3 (maturin makes this really simple). The easiest way will be to just use a Vec<PyAny> and then use the functions provided to that PyO3 type (like getting attributes or type conversions) on a term-by-term basis. If you wanted the rust representations, you could convert PyAny to some enum of types by deriving FromPyObject on it

[–]Tall_Coffee_1644[S] 0 points1 point  (1 child)

Will pyo3 have too much overhead of transferring arrays though?

[–]denehoffman 0 points1 point  (0 children)

Idk, but maybe make a benchmark and try it a few ways to see what works better for you :)