Merge pull request #1048 from davidhewitt/fix-from-type-ptr-doc
Fix doc for PyType::from_type_ptr
This commit is contained in:
commit
264e8854c6
|
@ -29,8 +29,10 @@ impl PyType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieves the `PyType` instance for the given FFI pointer.
|
/// Retrieves the `PyType` instance for the given FFI pointer.
|
||||||
/// This increments the reference count on the type object.
|
///
|
||||||
/// Undefined behavior if the pointer is NULL or invalid.
|
/// # Safety
|
||||||
|
/// - The pointer must be non-null.
|
||||||
|
/// - The pointer must be valid for the entire of the lifetime for which the reference is used.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn from_type_ptr(py: Python, p: *mut ffi::PyTypeObject) -> &PyType {
|
pub unsafe fn from_type_ptr(py: Python, p: *mut ffi::PyTypeObject) -> &PyType {
|
||||||
py.from_borrowed_ptr(p as *mut ffi::PyObject)
|
py.from_borrowed_ptr(p as *mut ffi::PyObject)
|
||||||
|
|
Loading…
Reference in New Issue