Skip to content

How to get reference of an inner object in python? #3020

Answered by davidhewitt
sun-rs asked this question in Questions
Discussion options

You must be logged in to vote

You should write

#[pyclass]
struct Parent {
    child: Py<Child>,
}

i.e. Parent will store a Python reference to a Child object, instead of just the Rust struct.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sun-rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants