Skip to content

Failing to convert struct to equivalent pyobject #3013

Discussion options

You must be logged in to vote

Try this instead:

    fn delegate_call(&self, py: Python<'_>) -> PyResult<Py<Str>> {
        let s: Str = process_rprop(self.clone().into()).into();
        Py::new(py, (s, Prop::new()))
    }

The reason is that Str doesn't implement IntoPy, because it needs to have a Prop base class paired with it when built into a Python object.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shivam-880
Comment options

@davidhewitt
Comment options

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