Function value_to_pyobject
Source pub fn value_to_pyobject(py: Python<'_>, val: &Value) -> PyResult<PyObject>
Expand description
Converts a JSON Value
into a corresponding Python object.
§Panics
Panics if parsing numbers (as_i64
, as_f64
) or creating the Python list (PyList::new().expect
) fails.
§Errors
Returns a PyErr
if:
- encountering an unsupported JSON number type.
- conversion of nested arrays or objects fails.