Skip to content

Returning () via future_into_py creates empty tuple, not None #31

@kylebarron

Description

@kylebarron

Found in developmentseed/obstore#240 and with a small repro here

#[pyfunction]
pub(crate) fn return_none_async(py: Python) -> PyResult<Bound<PyAny>> {
    pyo3_async_runtimes::tokio::future_into_py(py, async move { Ok(()) })
}
Image

This is in contrast to normal pyo3 where returning () from Rust creates a Python None.

Using pyo3 0.23 and pyo3-async-runtimes 0.23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions