You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make any old Python function in Rust with Pyo3 that:
Returns a Python bytes / Rust PyBytes object
That may also throw an exception
#[pyfunction]fnget_bytes(py:Python,throw:bool) -> PyResult<PyBytes>{if throw {Err(PyErr::new::<exceptions::Exception,_>("Throw was set."))}else{Ok(*PyBytes::new(py,&[1,2,3,4]))}}
All names shown are from std or pyo3.
Rust complains that the trait 'pyo3::derive_utils::IntoPyResult<_>' is not implemented for 'std::result::Result<pyo3::types::bytes::PyBytes, pyo3::err::PyErr>'.
🌍 Environment
Manjaro 19.0.2 Kyria, x86_64 Linux 5.4.31-1-MANJARO
Python 3.8.2, installed via pamac
Rustc 1.43.0-nightly (564758c4c 2020-03-08), installed via rustup pamac
Pyo3 0.9.2
The text was updated successfully, but these errors were encountered:
Oh wow, LOL, this is quite embarrassing.
I'm very sorry for wasting your time, I'll be sure to do more tinkering and research before I open any other issues. ;p
💥 Reproducing
Make any old Python function in Rust with Pyo3 that:
bytes
/ RustPyBytes
objectAll names shown are from
std
orpyo3
.Rust complains that
the trait 'pyo3::derive_utils::IntoPyResult<_>' is not implemented for 'std::result::Result<pyo3::types::bytes::PyBytes, pyo3::err::PyErr>'
.🌍 Environment
The text was updated successfully, but these errors were encountered: