pyo3/types/num.rs
1use crate::{ffi, PyAny};
2
3/// Represents a Python `int` object.
4///
5/// Values of this type are accessed via PyO3's smart pointers, e.g. as
6/// [`Py<PyLong>`][crate::Py] or [`Bound<'py, PyLong>`][crate::Bound].
7///
8/// You can usually avoid directly working with this type
9/// by using [`ToPyObject`](crate::conversion::ToPyObject)
10/// and [`extract`](super::PyAnyMethods::extract)
11/// with the primitive Rust integer types.
12#[repr(transparent)]
13pub struct PyLong(PyAny);
14
15pyobject_native_type_core!(PyLong, pyobject_native_static_type_object!(ffi::PyLong_Type), #checkfunction=ffi::PyLong_Check);