pub fn parse_float(s: &str) -> Option<f64>
Python’s float(str): accepts surrounding whitespace, underscores between digits, inf/nan spellings, and everything Rust’s parser accepts.
float(str)
inf
nan