Skip to content

How to convert &PyClass to Py<PyAny> in #[pymethods]? #3696

Answered by adamreichold
armoha asked this question in Questions
Discussion options

You must be logged in to vote

I think you second try is actually correct, you just need to change the way you call it to universal function call syntax, i.e.

fn __radd__(slf: Py<Self>, py: Python, rhs: i32) -> PyResult<Self> {
    Self::__add__(slf, py, rhs)
}

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@adamreichold
Comment options

@armoha
Comment options

@adamreichold
Comment options

@adamreichold
Comment options

@adamreichold
Comment options

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