Better doc comment for PyObject

This commit is contained in:
konstin 2018-10-31 11:58:19 +01:00
parent 8b27f1e412
commit 264f642f19
1 changed files with 7 additions and 1 deletions

View File

@ -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