2021-08-01 21:41:32 +00:00
|
|
|
use pyo3::{types::PyDict, Py, Python};
|
2020-04-20 17:44:31 +00:00
|
|
|
|
|
|
|
fn main() {
|
2022-08-15 01:34:47 +00:00
|
|
|
#[allow(deprecated)]
|
2020-04-20 17:44:31 +00:00
|
|
|
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.
|
|
|
|
}
|