pub fn version_info(self) -> PythonVersionInfo<'p> {
        let version_str = self.version();

        // Portion of the version string returned by Py_GetVersion up to the first space is the
        // version number.
        let version_number_str = version_str.split(' ').next().unwrap_or(version_str);

        PythonVersionInfo::from_str(version_number_str)
    }
/// Gets the running Python interpreter version as a struct similar to
/// `sys.version_info`.
///
/// # Examples
/// ```rust
/// # use pyo3::Python;
/// Python::with_gil(|py| {
///     // PyO3 supports Python 3.6 and up.
///     assert!(py.version_info() >= (3, 6));
///     assert!(py.version_info() >= (3, 6, 0));
/// });
/// ```
Gets the running Python interpreter version as a struct similar to
`sys.version_info`.
Gets the running Python interpreter version as a struct similar to ` sys . version_info ` .
pub fn version_info(self) -> PythonVersionInfo<'p> {
        let version_str = self.version();
        // Portion of the version string returned by Py_GetVersion up to the first space is the
        // version number.
        let version_number_str = version_str.split(' ').next().unwrap_or(version_str);
        PythonVersionInfo::from_str(version_number_str)
    }
pub fn version_info ( self ) -> PythonVersionInfo < ' p > { let version_str = self . version ( ) ; // Portion of the version string returned by Py_GetVersion up to the first space is the // version number. let version_number_str = version_str . split ( ' ' ) . next ( ) . unwrap_or ( version_str ) ; PythonVersionInfo :: from_str ( version_number_str ) }
Gets the running Python interpreter version as a struct similar to
`sys.version_info`.
Gets the running Python interpreter version as a struct similar to ` sys . version_info ` .
self
examples
None
use pyo3::python;
:with_gil(|py| {
PyO3 supports Python 3.6 and up.
: with_gil ( |py| { PyO3 supports Python 3 . 6 and up .