Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kylebarron opened this issue Feb 7, 2025 · 1 comment
Open

Comments

@kylebarron
Copy link
Contributor

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.

@davidhewitt
Copy link
Member

Hmm, interesting. This is related maybe to PyO3/pyo3#4896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants