Skip to main content

pyo3_ffi/
rangeobject.rs

1use crate::object::*;
2use std::ffi::c_int;
3
4extern_libpython! {
5    #[cfg_attr(PyPy, link_name = "PyPyRange_Type")]
6    pub static mut PyRange_Type: PyTypeObject;
7    pub static mut PyRangeIter_Type: PyTypeObject;
8    pub static mut PyLongRangeIter_Type: PyTypeObject;
9}
10
11#[inline]
12pub unsafe fn PyRange_Check(op: *mut PyObject) -> c_int {
13    (Py_TYPE(op) == &raw mut PyRange_Type) as c_int
14}