Skip to content

Need help in debugging the below compiler error #3381

Answered by davidhewitt
psvri asked this question in Questions
Discussion options

You must be logged in to vote

Instead of

    if obj.is_instance_of::<Number>() {
        Cow::Borrowed(obj.extract::<&Number>().unwrap())
    }

try

    if let Ok(c) = obj.downcast::<PyCell<Number>>() {
        Cow::Borrowed(c.get())
    }

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@psvri
Comment options

@davidhewitt
Comment options

@psvri
Comment options

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