pyo3/tests/ui/wrong_aspyref_lifetimes.rs
2020-08-09 22:47:54 +01:00

11 lines
302 B
Rust

use pyo3::{types::PyDict, Py, PyNativeType, Python};
fn main() {
let gil = Python::acquire_gil();
let dict: Py<PyDict> = PyDict::new(gil.python()).into();
let dict: &PyDict = dict.as_ref(gil.python());
drop(gil);
let _py: Python = dict.py(); // Obtain a Python<'p> without GIL.
}