Fix PyRef example

This commit is contained in:
Alexander Niederbühl 2019-03-03 20:18:55 +01:00
parent 90bf482fa1
commit 1ea59296ae

View file

@ -45,9 +45,9 @@ let gil = Python::acquire_gil();
let py = gil.python();
let obj = PyRef::new(py, MyClass { num: 3, debug: true }).unwrap();
assert_eq!(obj.num, 3);
let dict = PyDict::new();
let dict = PyDict::new(py);
// You can treat a `PyRef` as a Python object
dict.set_item("obj", obj)).unwrap();
dict.set_item("obj", obj).unwrap();
```
### `PyRefMut`