Skip to content
Discussion options

You must be logged in to vote

I think something like this will work:

let algo_owned;
let algorithm = if algorithm.is_instance(&types::NO_DIGEST_INFO.get(py)?)? {
    algo_owned = pyo3::types::PyNone::get(py).to_owned().into_any();
    &algo_owned
} else {
    algorithm
};

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tarnum-tst
Comment options

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