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
However, I get an error saying "the trait IntoPyCallbackOutput<_> is not implemented for Result<(pyo3::Py<PyAny>, PyBytes), PyErr>". Is there any reason this trait would not be implemented for PyBytes?
I can solve the problem by returning a Vec<u8>, but that seems less Pythonic.
Update: This seems to apply for all Py... types, i.e, I can't return a Pylist either.
The text was updated successfully, but these errors were encountered:
vedantroy
changed the title
Cannot return PyBytes?
Cannot return PyBytes / PyList?
Apr 7, 2021
Sorry for my slow response! The return type needs to be PyResult<(Py<PyAny>, &PyBytes)> or PyResult<(Py<PyAny>, Py<PyBytes>)>.
(Plain PyBytes isn't meaningful with PyO3 - it needs to be wrapped as a pointer either as &PyBytes or Py<PyBytes>. This is likely going to improve eventually with #1308.)
I have the following:
However, I get an error saying "the trait
IntoPyCallbackOutput<_>
is not implemented forResult<(pyo3::Py<PyAny>, PyBytes), PyErr>
". Is there any reason this trait would not be implemented forPyBytes
?I can solve the problem by returning a
Vec<u8>
, but that seems less Pythonic.Update: This seems to apply for all
Py...
types, i.e, I can't return aPylist
either.The text was updated successfully, but these errors were encountered: