pyo3/tests/ui/missing_clone.rs
2020-01-24 08:57:28 +00:00

17 lines
295 B
Rust

use pyo3::prelude::*;
#[pyclass]
struct TestClass {
num: u32,
}
fn main() {
let t = TestClass { num: 10 };
let gil = Python::acquire_gil();
let py = gil.python();
let pyvalue = Py::new(py, t).unwrap().to_object(py);
let t: TestClass = pyvalue.extract(py).unwrap();
}