Merge pull request #383 from Alexander-N/fix-examples

Fix PyRef example
This commit is contained in:
Yuji Kanagawa 2019-03-04 12:47:10 +09:00 committed by GitHub
commit 0866dd8989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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`