Skip to content
Discussion options

You must be logged in to vote

I think the problem is the #[derive(FromPyObject)] which usually doesn't make sense for a #[pyclass] because it does not need to be converted from its Python representation as it can be accessed as it is. But not as a plain type, but rather by accepting Py<ComponentHandle> or PyRef(Mut)<ComponentHandle> which will give you access to the instance in-place stored on the Python heap.

(The derived FromPyObject actually tries to create a new ComponentHandle by filling in its field from attributes of any given Python object which is where the confusing error comes from.)

(Maybe we should prevent that compiling but theoretically it could be used.)

Replies: 1 comment 4 replies

Comment options

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

@davidhewitt
Comment options

@facundo-villa
Comment options

@adamreichold
Comment options

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