Skip to content

Commit 264f642

Browse files
committed
Better doc comment for PyObject
1 parent 8b27f1e commit 264f642

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/object.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ use crate::python::{IntoPyPointer, Python, ToPyPointer};
1212
use crate::pythonrun;
1313
use crate::types::{PyDict, PyObjectRef, PyTuple};
1414

15-
/// Safe wrapper around unsafe `*mut ffi::PyObject` pointer.
15+
/// A python object
16+
///
17+
/// The python object's lifetime is managed by python's garbage
18+
/// collector.
19+
///
20+
/// Technically, it is a safe wrapper around the unsafe `*mut ffi::PyObject` pointer.
1621
#[derive(Debug)]
1722
#[repr(transparent)]
1823
pub struct PyObject(*mut ffi::PyObject);
@@ -285,6 +290,7 @@ impl IntoPyPointer for PyObject {
285290
}
286291

287292
impl PartialEq for PyObject {
293+
/// Checks for identity, not python's `__eq__`
288294
#[inline]
289295
fn eq(&self, o: &PyObject) -> bool {
290296
self.0 == o.0

0 commit comments

Comments
 (0)