Skip to content

Understanding errors from into_pyobject() #4781

Answered by mejrs
CastilloDel asked this question in Questions
Discussion options

You must be logged in to vote

There are some cases where the conversion needs to import a type or call a python method, which can fail. Things like the date/time/hashmap etc related implementations are examples of conversions that can fail. On the other hand, if they cannot fail they use Infallible as the error type which means that on a new enough Rust you can write

let Ok(x) = y.into_pyobject();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@CastilloDel
Comment options

Answer selected by CastilloDel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants