Struct pyo3::PythonVersionInfo
source · pub struct PythonVersionInfo<'py> {
pub major: u8,
pub minor: u8,
pub patch: u8,
pub suffix: Option<&'py str>,
}
Expand description
Represents the major, minor, and patch (if any) versions of this interpreter.
This struct is usually created with Python::version
.
Examples
Python::with_gil(|py| {
// PyO3 supports Python 3.7 and up.
assert!(py.version_info() >= (3, 7));
assert!(py.version_info() >= (3, 7, 0));
});
Fields§
§major: u8
Python major version (e.g. 3
).
minor: u8
Python minor version (e.g. 11
).
patch: u8
Python patch version (e.g. 0
).
suffix: Option<&'py str>
Python version suffix, if applicable (e.g. a0
).
Trait Implementations§
source§impl<'py> Debug for PythonVersionInfo<'py>
impl<'py> Debug for PythonVersionInfo<'py>
source§impl PartialEq<(u8, u8, u8)> for PythonVersionInfo<'_>
impl PartialEq<(u8, u8, u8)> for PythonVersionInfo<'_>
source§impl PartialEq<(u8, u8)> for PythonVersionInfo<'_>
impl PartialEq<(u8, u8)> for PythonVersionInfo<'_>
source§impl PartialOrd<(u8, u8, u8)> for PythonVersionInfo<'_>
impl PartialOrd<(u8, u8, u8)> for PythonVersionInfo<'_>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<(u8, u8)> for PythonVersionInfo<'_>
impl PartialOrd<(u8, u8)> for PythonVersionInfo<'_>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more