Skip to content
Discussion options

You must be logged in to vote

#[pyclass] is currently always wrapped inside a PyCell to support interior mutability in the face pervasive shared ownership in Python. The #[derive(Clone)] should not be necessary at all AFAIU. I think you just need to extract PyRefMut<KoloProfiler> instead of a plain KoloProfiler which is a clone of the cell contents, e.g.

let obj = obj.extract::<PyRefMut<KoloProfiler>>(py);

which will call PyCell::try_borrow_mut behind the scenes.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@LilyAcorn
Comment options

LilyAcorn Jan 23, 2023
Collaborator Author

Comment options

You must be logged in to vote
1 reply
@LilyAcorn
Comment options

LilyAcorn Jan 23, 2023
Collaborator Author

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