From 1ea59296aee7655ae4627d57cc28328cbb68c9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Niederb=C3=BChl?= Date: Sun, 3 Mar 2019 20:18:55 +0100 Subject: [PATCH] Fix PyRef example --- guide/src/class.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/src/class.md b/guide/src/class.md index 30d8732f..fab6abd0 100644 --- a/guide/src/class.md +++ b/guide/src/class.md @@ -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`