Struct cpython::PyFloat [−][src]
pub struct PyFloat(_);
Expand description
Represents a Python float
object.
You can usually avoid directly working with this type
by using ToPyObject
and extract
with f32
/f64
.
Implementations
Trait Implementations
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Casts the Python object to PyObject.
fn downcast_from<'p>(
py: Python<'p>,
obj: PyObject
) -> Result<PyFloat, PythonObjectDowncastError<'p>>
fn downcast_from<'p>(
py: Python<'p>,
obj: PyObject
) -> Result<PyFloat, PythonObjectDowncastError<'p>>
Cast from PyObject to a concrete Python object type.
fn downcast_borrow_from<'a, 'p>(
py: Python<'p>,
obj: &'a PyObject
) -> Result<&'a PyFloat, PythonObjectDowncastError<'p>>
fn downcast_borrow_from<'a, 'p>(
py: Python<'p>,
obj: &'a PyObject
) -> Result<&'a PyFloat, PythonObjectDowncastError<'p>>
Cast from PyObject to a concrete Python object type.
Retrieves the type object for this Python object type.
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyFloat
Converts self into a Python object.
Converts self into a Python object. Read more