Skip to main content

pyo3_ffi/
rangeobject.rs

1use crate::object::*;
2use core::ffi::c_int;
3
4extern_libpython! {
5    #[cfg(not(RustPython))]
6    #[cfg_attr(PyPy, link_name = "PyPyRange_Type")]
7    pub static mut PyRange_Type: PyTypeObject;
8    #[cfg(not(RustPython))]
9    pub static mut PyRangeIter_Type: PyTypeObject;
10    #[cfg(not(RustPython))]
11    pub static mut PyLongRangeIter_Type: PyTypeObject;
12
13    #[cfg(RustPython)]
14    pub fn PyRange_Check(op: *mut PyObject) -> c_int;
15}
16
17#[inline]
18#[cfg(not(RustPython))]
19pub unsafe fn PyRange_Check(op: *mut PyObject) -> c_int {
20    Py_IS_TYPE(op, &raw mut PyRange_Type)
21}
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here