Implement PyNone.get() using PyNone.get_bound()

This commit is contained in:
Blaž Šnuderl 2024-02-05 08:06:30 +01:00
parent 1fd0aa2b19
commit f1384f3582
1 changed files with 2 additions and 2 deletions

View File

@ -15,12 +15,12 @@ impl PyNone {
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`PyNone::get` will be replaced by `PyBool::get_bound` in a future PyO3 version"
note = "`PyNone::get` will be replaced by `PyNone::get_bound` in a future PyO3 version"
)
)]
#[inline]
pub fn get(py: Python<'_>) -> &PyNone {
unsafe { py.from_borrowed_ptr(ffi::Py_None()) }
Self::get_bound(py).into_gil_ref()
}
/// Returns the `None` object.