-
Notifications
You must be signed in to change notification settings - Fork 795
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
Cannot return option from PySequenceProtocol
__getitem__
#798
Comments
Similar errors seem to arise in other places such as using an option in |
Thank you for filing! |
This is because we treat |
I wonder if we can use Give me a chance to play around with a PR for this later tonight 😄 |
So I took a look tonight, it's not super easy but I think a solution is possible using the callback conversion code, though it might need a little refactoring. I'll continue to play through the week, not sure when a PR would be ready. |
Just a final note on this having explored it further - any solution will need quite a few changes, so I don't think you should feel you have to wait for this for |
What I meant as the problem of the current def iter_():
for i in range(5):
yield i;
return "Ended" So
Using a custom callback converter could be a good idea, but I'm not sure it is a general solution. |
🐛 Bug Reports
When reporting a bug, please provide the following information. If this is not a bug report you can just discard this template.
🌍 Environment
rustc --version
): rustc 1.43.0-nightly (18c275b42 2020-03-02)version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
Yes, using latest master💥 Reproducing
lib.rs
Problem:
"the trait bound
std::result::Result<i64, pyo3::err::PyErr>: std::convert::From<std::result::Result<std::option::Option<i64>, pyo3::err::PyErr>>
is not satisfied"I don't want to convert from
std::result::Result<std::option::Option<i64>, pyo3::err::PyErr>
tostd::result::Result<i64, pyo3::err::PyErr>
. I want to return anstd::result::Result<Option<i64>, pyo3::err::PyErr>
The text was updated successfully, but these errors were encountered: