This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
Replies: 1 comment 2 replies
-
Cool question. In general we can't share mutable data between Rust and Python safely - if Python mutates it at the same time as Rust mutates it, we have undefined behavior 💥. You mentioned that Python only reads it. In that case, can't you use Or, would you like to afterwards modify it afterwards? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Here's my use case: I am building up arrays (
MutablePrimitiveArray
, but I am open to alternatives) in Rust, item by item, and I need to share the data with python (I call the python code through pyo3). The python code only only needs to read the data.Using
ffi::export_array_to_c
requires changing theMutablePrimitiveArray
toArc<dyn Array>
viaas_arc()
orinto_arc()
, which empties it.Beta Was this translation helpful? Give feedback.
All reactions