From 264f642f19005a7a65640d95e48ced1b958edf59 Mon Sep 17 00:00:00 2001 From: konstin Date: Wed, 31 Oct 2018 11:58:19 +0100 Subject: [PATCH] Better doc comment for PyObject --- src/object.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/object.rs b/src/object.rs index a947f080..48866c6e 100644 --- a/src/object.rs +++ b/src/object.rs @@ -12,7 +12,12 @@ use crate::python::{IntoPyPointer, Python, ToPyPointer}; use crate::pythonrun; use crate::types::{PyDict, PyObjectRef, PyTuple}; -/// Safe wrapper around unsafe `*mut ffi::PyObject` pointer. +/// A python object +/// +/// The python object's lifetime is managed by python's garbage +/// collector. +/// +/// Technically, it is a safe wrapper around the unsafe `*mut ffi::PyObject` pointer. #[derive(Debug)] #[repr(transparent)] pub struct PyObject(*mut ffi::PyObject); @@ -285,6 +290,7 @@ impl IntoPyPointer for PyObject { } impl PartialEq for PyObject { + /// Checks for identity, not python's `__eq__` #[inline] fn eq(&self, o: &PyObject) -> bool { self.0 == o.0